S3错误:使用嵌套堆栈部署CFN模板时访问被拒绝

问题描述

我正在尝试启动CFN模板化的嵌套堆栈。子堆栈与我要通过CFN控制台启动的父容器位于同一区域的存储桶中。

我具有管理员访问权限,并且能够通过单个CFN模板创建资源,但是由于某些原因,当使用嵌套堆栈时,会返回以下错误

The following resource(s) Failed to create: [My-Sns-Stack]. . Rollback requested by user.
My-Sns-Stack    CREATE_Failed   S3 error: Access Denied For more information check http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html

我检查了以下资源,但不能解决问题:

Specifying an S3 bucket when deploying a cloudformation template

https://www.reddit.com/r/aws/comments/bjk3qw/cloudformation_nested_stacks_s3_access/

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html

...
    Resources:
        Snsstack:
            Type: AWS::CloudFormation::Stack
            Properties:
                TemplateURL: !Ref SnsstackUrl
                TimeoutInMinutes: 15
...

解决方法

我发现此错误没有用,因为我认为它与 CloudFormation 模板无法访问 in 中引用的 S3 资源有关。结果证明它更简单,“拒绝访问”错误实际上表示 S3 文件未找到包含我的 CloudFormation 模板。在对我嵌套的 CloudFormation 堆栈的引用中,TemplateURL: 有一个错字。