0

其他资源(例如 EC2)可以毫无问题地创建,但无法创建 PublicRead s3 存储桶。

Resources:
  MyS3Bucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: helloworldwebsite
      AccessControl: PublicRead
      WebsiteConfiguration:
        IndexDocument: index.html

命令是:

aws cloudformation create-stack --stack-name myteststack --template-body "file:///path/to/S3-template.yaml"

这是 CloudFormation / Stacks 的屏幕截图:

在此处输入图像描述

4

1 回答 1

1

你的模板是正确的。唯一可能的问题是存储桶名称helloworldwebsite 已经存在。存储桶名称在所有区域和账户中必须是全局唯一的。因此,请将其更改BucketName为新的,例如:

Resources:
  MyS3Bucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: helloworldwebsite222232111
      AccessControl: PublicRead
      WebsiteConfiguration:
        IndexDocument: index.html
于 2020-12-28T22:49:30.653 回答