@@ -20,14 +20,15 @@ Please pull request if you are intersted in it.
2020
2121- Kinesis Streams
2222- SQS
23+ - S3
2324
2425## How to use
2526
2627Define settings of the AWS services you want to integrate under ` custom > apiGatewayServiceProxies ` and run ` serverless deploy ` .
2728
2829### Kinesis
2930
30- Sample syntax for Kinesis proxy in serverless.yml.
31+ Sample syntax for Kinesis proxy in ` serverless.yml ` .
3132
3233``` yaml
3334custom :
@@ -49,12 +50,12 @@ resources:
4950Sample request after deploying.
5051
5152` ` ` bash
52- curl -XPOST https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/kinesis -d '{"Data" : " some data" ,"PartitionKey": "some key"}' -H 'Content-Type:application/json'
53+ curl -X POST https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/kinesis -d '{"Data" : " some data" ,"PartitionKey": "some key"}' -H 'Content-Type:application/json'
5354` ` `
5455
5556### SQS
5657
57- Sample syntax for SQS proxy in serverless.yml.
58+ Sample syntax for SQS proxy in ` serverless.yml` .
5859
5960` ` ` yaml
6061custom:
@@ -74,7 +75,55 @@ resources:
7475Sample request after deploying.
7576
7677` ` ` bash
77- curl -XPOST https://xxxxxx.execute-api.us-east-1.amazonaws.com/dev/sqs -d '{"message" : " testtest" }' -H 'Content-Type:application/json'
78+ curl -X POST https://xxxxxx.execute-api.us-east-1.amazonaws.com/dev/sqs -d '{"message": "testtest"}' -H 'Content-Type:application/json'
79+ ` ` `
80+
81+ # ## S3
82+
83+ Sample syntax for S3 proxy in `serverless.yml`.
84+
85+ ` ` ` yaml
86+ custom:
87+ apiGatewayServiceProxies:
88+ - s3:
89+ path: /s3
90+ method: post
91+ action: PutObject
92+ bucket:
93+ Ref: S3Bucket
94+ key: static-key.json # use static key
95+ cors: true
96+
97+ - s3:
98+ path: /s3/{myKey} # use path param
99+ method: get
100+ action: GetObject
101+ bucket:
102+ Ref: S3Bucket
103+ key:
104+ pathParam: myKey
105+ cors: true
106+
107+ - s3:
108+ path: /s3
109+ method: delete
110+ action: DeleteObject
111+ bucket:
112+ Ref: S3Bucket
113+ key:
114+ queryStringParam: key # use query string param
115+ cors: true
116+
117+ resources:
118+ Resources:
119+ S3Bucket:
120+ Type: 'AWS::S3::Bucket'
121+ ` ` `
122+
123+ Sample request after deploying.
124+
125+ ` ` ` bash
126+ curl -X POST https://xxxxxx.execute-api.us-east-1.amazonaws.com/dev/s3 -d '{"message": "testtest"}' -H 'Content-Type:application/json'
78127` ` `
79128
80129# # Common API Gateway features
0 commit comments