本文介绍了AWS Bucket策略无效的资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用AWS Bucket策略时遇到了一些麻烦,我按照说明进行操作,并且它不允许我设置策略,所以我无法让我的域使用这些Buckets.

I'm having some trouble with AWS Bucket policies, I followed the instruction and it doesn't let me set the policy, so I can't get my domain to work with the buckets.

这是张照片.该教程告诉我用我的存储桶名称替换example.com.

Here is a picture. The tutorial told me to replace example.com with my bucket name.

我已经尝试在我的域中设置存储桶已有一个多月了,但似乎还是无法解决.我已经购买了我的域名,这是我想要的确切域名,所以我不想被迫使用新域名去Bluehost.

I've been trying to set up my buckets with my domain for over a month now and I just can't seem to get it going. I already purchased my domain, and it's the exact domain name I want, so I don't want to be forced to go to Bluehost with a new domain.

推荐答案

这很简单:

  • 您的存储桶称为www.justdiditonline.com
  • 您的存储桶策略正在尝试为名为justdiditonline.com
  • 的存储桶创建规则
  • 存储桶名称不匹​​配
  • Your bucket is called www.justdiditonline.com
  • Your bucket policy is attempting to create a rule for a bucket named justdiditonline.com
  • The bucket names do not match

解决方案:使用具有正确存储桶名称的策略:

Solution: Use a policy with the correct bucket name:

{
  "Id": "Policy1",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::www.justdiditonline.com/*",
      "Principal": "*"
    }
  ]
}

我注意到您还有一个名为justdiditonline.com的存储桶.您现有的策略将适用于该存储桶.

I notice you have another bucket called justdiditonline.com. Your existing policy would work on that bucket.

设置静态使用自定义域的网站" 说明详细说明了操作方法,并且它们可以与使用CNAME指向静态网站URL的外部DNS服务配合使用.主要步骤是:

The Setting Up a Static Website Using a Custom Domain instructions detail what to do, and they work fine with an external DNS service using a CNAME to point to the static website URL. The main steps are:

  • 创建一个域名为www.justdiditonline.com
  • 的存储桶
  • 添加存储桶策略以公开内容,或确保您要提供的单个对象是公开可读的
  • 在存储桶上
  • 激活静态网站托管,它将返回如下网址:www.justdiditonline.com.s3.amazonaws.com
  • www.justdiditonline.com创建 DNS条目,其中CNAME指向静态网站托管URL
  • Create a bucket with the domain name www.justdiditonline.com
  • Add a bucket policy to make content public, or make sure the individual objects you want to serve are publicly readable
  • Activate Static Website Hosting on the bucket, which will return a URL like: www.justdiditonline.com.s3.amazonaws.com
  • Create a DNS entry for www.justdiditonline.com with a CNAME pointing to the Static Website Hosting URL

这篇关于AWS Bucket策略无效的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 20:52