Created
November 22, 2018 20:11
-
-
Save sreesarma/a3fcd5a7d47d51438814314efd7c003d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save Directly to S3 -- serverless.yml | |
service: css-s3-test # NOTE: update this with your service name | |
plugins: | |
- serverless-offline | |
custom: | |
bucket: your-s3-bucket-name-here | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
iamRoleStatements: | |
- Effect: 'Allow' | |
Action: 'S3:*' | |
Resource: "arn:aws:s3:::${self:custom.bucket}/*" | |
functions: | |
save: | |
description: "Upload JSON Directly to S3" | |
handler: handler.save | |
environment: | |
bucket: ${self:custom.bucket} | |
events: | |
- http: | |
path: save | |
method: post | |
cors: true | |
request: | |
parameters: | |
body: | |
data: true | |
resources: | |
Resources: | |
MyBucket: | |
Type: AWS::S3::Bucket | |
Properties: | |
BucketName: your-s3-bucket-name-here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment