Carlos Aguni

Highly motivated self-taught IT analyst. Always learning and ready to explore new skills. An eternal apprentice.


AWS Route53 AWS S3 Static Hosting Vue SPA

25 Sep 2022 »

CORS

https://docs.aws.amazon.com/AmazonS3/latest/userguide/ManageCorsUsing.html

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "POST",
            "PUT",
            "DELETE"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]

Route53

https://medium.com/graymatrix/route-53-to-route-traffic-to-an-s3-bucket-when-both-the-services-are-in-different-aws-accounts-daa54f8570c9

Hosted Zone name : “test.com”

S3 bucket name : “dummy.test.com”

Record name : “dummy”

Static website hosting

[
    {
        "Condition": {
            "HttpErrorCodeReturnedEquals": "404"
        },
        "Redirect": {
            "HostName": "<host>",
            "HttpRedirectCode": "307",
            "Protocol": "http",
            "ReplaceKeyPrefixWith": "#!/"
        }
    }
]

https://stackoverflow.com/questions/64598842/aws-s3-redirection-rules-not-letting-me-saving-it

https://stackoverflow.com/questions/16267339/s3-static-website-hosting-route-all-paths-to-index-html

ACL enable

Bucket Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Statement1",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::<bucket name>/*"
        }
    ]
}