Skip to content

Instantly share code, notes, and snippets.

@richardgrantserverless
Created May 23, 2022 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardgrantserverless/bb07dbc20246887030927a1c3ed829b9 to your computer and use it in GitHub Desktop.
Save richardgrantserverless/bb07dbc20246887030927a1c3ed829b9 to your computer and use it in GitHub Desktop.
provider:
name: aws
runtime: nodejs4.3
stage: dev
# We want to lock down the ApiGateway, so we can control who can use the api
apiKeys:
- thumbnail-api-key
# We need to give the lambda functions access to list and write to our bucket, it needs:
# - to be able to 'list' the bucket
# - to be able to upload a file (PutObject)
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:ListBucket"
- "s3:PutObject"
Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ThumbnailBucket" } ] ] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment