---
Resources:
  NextStaticAssetsS3Bucket:
    Type: AWS::S3::Bucket
    Properties:
      AccessControl: PublicRead
      CorsConfiguration:
        CorsRules:
          - AllowedHeaders: ["*"]
            AllowedMethods: [GET]
            AllowedOrigins: ["*"]
            ExposedHeaders: [Date]
            Id: NextStaticAssetsS3BucketId1
            MaxAge: "3600"
      BucketName: TO_BE_REPLACED
      WebsiteConfiguration:
        IndexDocument: index.html
        ErrorDocument: error.html
    DeletionPolicy: Retain
Outputs:
  NextStaticAssetsS3BucketWebsiteURL:
    Value: !GetAtt [NextStaticAssetsS3Bucket, WebsiteURL]
    Description: URL for the S3 website hosting the static assets
  NextStaticAssetsS3BucketSecureURL:
    Value:
      !Join ["", ["https://", !GetAtt [NextStaticAssetsS3Bucket, DomainName]]]
    Description: S3 Bucket which holds the static assets
