【问题标题】:AWS Cloudfront Origin Failover with S3 buckets in same regionAWS Cloudfront Origin Failover 与同一区域中的 S3 存储桶
【发布时间】:2020-09-25 02:02:47
【问题描述】:

第一个存储桶,something-cf-validate-origin-primary-devops,在 S3 存储桶的根目录中有 index.html 和内容,

<html>
<body>
Home page
</body>
</html>

第二个存储桶,something-cf-validate-origin-failover-devops,在 S3 存储桶的根目录中有 index.html。

<html>
<body>
Maintenance page
</body>
</html>

两个 S3 存储桶都启用了静态 Web 托管,并可通过端点公开访问。

Cloudfront Distribution 包含两个 Origin。

来源组如下,

行为指向 Origin 组,

Cloudfront 的默认根对象设置为 index.html

当我点击 Cloudfront Distribution 的域名时,我得到了“主页”。

当我在第一个存储桶中将 index.html 重命名为 index-disable.html 时,我应该得到“维护页面”,因为 Cloudfront 故障转移应该从第二个存储桶提供页面,因为它从第一个存储桶获得 404。

但是当我将 index.html 重命名为 index-disable.html 时,我得到“拒绝访问”。

【问题讨论】:

    标签: amazon-web-services amazon-s3 amazon-cloudfront failover


    【解决方案1】:

    您获得的状态是 403。

    来自 AWS documentation

    Check if the requested object exists in the bucket. If a user doesn’t have s3:ListBucket permissions, then the user gets Access Denied errors for missing objects instead of 404 Not Found errors. Run this AWS CLI command to check if an object exists in the bucket
    

    本例中的用户是 Bucket Policy,因此需要授予 s3:ListBucket 权限。

    403 也可能更容易进行故障转移。

    【讨论】:

      猜你喜欢
      • 2017-05-30
      • 1970-01-01
      • 1970-01-01
      • 2021-01-02
      • 2017-07-04
      • 2016-12-08
      • 2015-12-02
      • 2015-07-23
      • 2019-04-13
      相关资源
      最近更新 更多