Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services AWS Cloudfront原点故障切换,S3存储桶位于同一区域_Amazon Web Services_Amazon S3_Amazon Cloudfront_Failover - Fatal编程技术网

Amazon web services AWS Cloudfront原点故障切换,S3存储桶位于同一区域

Amazon web services AWS Cloudfront原点故障切换,S3存储桶位于同一区域,amazon-web-services,amazon-s3,amazon-cloudfront,failover,Amazon Web Services,Amazon S3,Amazon Cloudfront,Failover,第一个bucket是cf validate origin primary devops,在S3 bucket的根目录中包含index.html和内容 <html> <body> Home page </body> </html> 主页 第二个bucket是cf validate origin failover devops,它在S3 bucket的根中有index.html <html> <body> Maintena

第一个bucket是cf validate origin primary devops,在S3 bucket的根目录中包含index.html和内容

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

主页
第二个bucket是cf validate origin failover devops,它在S3 bucket的根中有index.html

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

维护页面
这两个S3存储桶都支持静态web托管,并可通过端点公开访问

Cloudfront分布包含两个来源

原产地组别如下:

行为指向原始组

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

当我点击Cloudfront发行版的域名时,我得到了“主页”

当我在第一个bucket中将index.html重命名为index-disable.html时,我应该得到“维护页面”,因为Cloudfront故障切换应该从第二个bucket提供页面服务,因为它从第一个bucket获得404


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

您得到的状态是403

来自美国焊接学会

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

403也可以更容易地进行故障切换

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