AWS S3とCloudFlareを接続できません

I have set AWS S3 in the Origin of Cloudflare according to the official document [1], but the images uploaded to AWS S3 cannot be viewed in the browser.

What I tried

1. Deploy AWS S3

I deployed by matching the bucket name with the domain I want to refer to.
Bucket name : assets . example .io

S3 Config

Setting a Static Hosting bucket.
The access policy is as follows.

{
    "Version": "2012-10-17",
    "Id": "PublicReadGetObject",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::assets.example.io/*",
            "Condition": {
                "NotIpAddress": {
                    "aws:SourceIp": [
                        "173.245.48.0",
                        "103.21.244.0",
                        "103.22.200.0",
                        "103.31.4.0",
                        "141.101.64.0",
                        "108.162.192.0",
                        "190.93.240.0",
                        "188.114.96.0",
                        "197.234.240.0",
                        "198.41.128.0",
                        "162.158.0.0",
                        "104.16.0.0",
                        "104.24.0.0",
                        "172.64.0.0",
                        "131.0.72.0"
                    ]
                }
            }
        },
        {
            "Sid": "PublicReadGetObjectAllow",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::assets.example.io/*"
        }
    ]
}

2. Add a CNAME record on Cloudflare’s DNS screen

I have set the following DNS records in Origin for AWS S3.

  • Type : CNAME
  • Name : assets
  • Targate : assets . example . io . s3-website-ap-northeast-1 . amazonaws . com
  • Proxy : true
  • TTL : auto

3. View

I referred to it at the following URL, but I couldn’t see the image. The error screen is as shown in the attached image.
https ://assets.example.io/hoge.jpg

[1] https://support.cloudflare.com/hc/en-us/articles/360037983412-Configuring-an-Amazon-Web-Services-static-site-to-use-Cloudflare

Sorry.

this question is moved.

I don’t know how to delete a post.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.