Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 644 Bytes

serverless-s3-exits-error.md

File metadata and controls

25 lines (22 loc) · 644 Bytes

Serverless S3 bucket exists error

To solve this issue there are two steps:

  1. remove s3 reference from events

  2. add CORS configruation as below:

      resources:
        Resources:
          S3BucketMyBucket:
            Type: AWS::S3::Bucket
            Properties:
              BucketName: bucketname-${self:provider.stage}
              CorsConfiguration:
                CorsRules:
                  - AllowedHeaders:
                      - "*"
                    AllowedMethods:
                      - GET
                      - POST
                      - PUT
                    AllowedOrigins:
                      - "*"