Last active
April 28, 2022 08:00
-
-
Save viktorfa/76e6ee19dd53e3f1a03db360eabb5263 to your computer and use it in GitHub Desktop.
Strapi Serverless config with S3 static bucket.
This file contains 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
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