You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.7 KiB

Create S3 static web

  • Create a bucket myforms3

  • Create a static web artifacts

    • Flutter : flutter build web
      • Upload build/web artifacts to S3 bucket
  • S3

    • Goto bucket properties

    • Enable Static website hosting feature

    • Enable public access

      • Goto Permissions

      • Disable Block public access (bucket settings)

      • Apply this settings to Bucket policy

        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Sid": "PublicReadGetObject",
                    "Effect": "Allow",
                    "Principal": "*",
                    "Action": "s3:GetObject",
                    "Resource": "arn:aws:s3:::myforms3/*"
                }
            ]
        }
        
    • Enable CORS to access external site

      • Goto Permissions

      • Apply this setting to Cross-origin resource sharing (CORS) to allow https://54e9e45d-c142-4c16-8467-bceb20cf68ca.mock.pstmn.io

        [
            {
                "AllowedHeaders": [
                    "*"
                ],
                "AllowedMethods": [
                    "PUT",
                    "POST",
                    "DELETE"
                ],
                "AllowedOrigins": [
                    "https://54e9e45d-c142-4c16-8467-bceb20cf68ca.mock.pstmn.io"
                ],
                "ExposeHeaders": []
            },
            {
                "AllowedHeaders": [],
                "AllowedMethods": [
                    "GET"
                ],
                "AllowedOrigins": [
                    "*"
                ],
                "ExposeHeaders": []
            }
        ]