Skip to content

Instantly share code, notes, and snippets.

@viktorfa

viktorfa/serverless.yml

Last active Aug 17, 2020
Embed
What would you like to do?
Strapi Serverless config with S3 static bucket.
service: sls-strapi
provider:
name: aws
runtime: nodejs12.x
profile: <your-aws-profile>
logRetentionInDays: ${self:custom.vars.logRetentionInDays, 1}
environment:
ADMIN_JWT_SECRET: "Just using dummy"
API_SERVICE_HOST: "https://l4rjveb7rk.execute-api.us-east-1.amazonaws.com/dev"
BUCKET_NAME: !Ref S3StaticBucket
# URL from a free Mongo Atlas cluster.
MONGODB_URI: "mongodb+srv://strapiowner:PASSWORD@cluster0.weldo.mongodb.net/strapi?retryWrites=true&w=majority"
iamRoleStatements:
- Effect: Allow
Action:
- "s3:*"
Resource:
- !Sub
- "#{BucketArn}/*"
- BucketArn: !GetAtt S3StaticBucket.Arn
- !GetAtt S3StaticBucket.Arn
resources:
Resources:
S3StaticBucket:
Type: AWS::S3::Bucket
custom:
apigwBinary:
types:
- "multipart/form-data"
plugins:
- serverless-offline
- serverless-cloudformation-sub-variables
- serverless-apigw-binary
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment