gpt4 book ai didi

amazon-web-services - 模板的资源 block 中 Unresolved 资源依赖关系 [arn:aws:s3:::alberto313131/*]

转载 作者:行者123 更新时间:2023-12-03 07:14:40 25 4
gpt4 key购买 nike

我在尝试通过控制台设计器创建 AWS CloudFormation 脚本时收到上述错误。我确信存储桶 alberto313131 存在。

这是完整的错误:

Template contains errors.: Template format error: Unresolved resource dependencies [arn:aws:s3:::alberto313131/*] in the Resources block of the template

这是完整的脚本,我正在使用:

Resources:
S3BP1KK1X:
Type: 'AWS::S3::BucketPolicy'
Properties:
Bucket:
Ref: "arn:aws:s3:::alberto313131/*"
PolicyDocument:
Statement:
- Sid: AddPerm
Effect: Allow
Principal: '*'
Action:
- "s3:GetObject"
Resource:
- "arn:aws:s3:::alberto313131/*"

最佳答案

来自CloudFormation S3 BucketPolicy doco

Properties

Bucket

The name of the Amazon S3 bucket to which the policy applies.

因此,您只需提供存储桶名称,而不是 ARN。

仅对于 PolicyDocumentStatement 部分内的 Resource,您才提供 ARN。

关于amazon-web-services - 模板的资源 block 中 Unresolved 资源依赖关系 [arn:aws:s3:::alberto313131/*],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55670740/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com