繁体   English   中英

AWS SAM 部署:无法创建托管资源

[英]AWS SAM Deployment: Failed to create managed resources

当我尝试使用sam deploy --guided部署 hello world SAM 应用程序时,出现以下错误。

Configuring SAM deploy
======================

        Looking for config file [samconfig.toml] :  Not found

        Setting default arguments for 'sam deploy'
        =========================================
        Stack Name [sam-app]: sam-app
        AWS Region [eu-west-1]: eu-west-1
        #Shows you resources changes to be deployed and require a 'Y' to initiate deploy
        Confirm changes before deploy [y/N]: y
        #SAM needs permission to be able to create roles to connect to the resources in your template
        Allow SAM CLI IAM role creation [Y/n]: y
        #Preserves the state of previously provisioned resources when an operation fails
        Disable rollback [y/N]: y
        HelloWorldFunction may not have authorization defined, Is this okay? [y/N]: y
        Save arguments to configuration file [Y/n]: y
        SAM configuration file [samconfig.toml]: 
        SAM configuration environment [default]: 

        Looking for resources needed for deployment:
        Creating the required resources...
Error: Failed to create managed resources: An error occurred (AccessDenied) when calling the CreateChangeSet operation: User: arn:aws:iam::899719
272550:user/xxxxxxxx@xxxxxxxxxxxxxxxxxxxxxxxx is not authorized to perform: cloudformation:CreateChangeSet on resource: arn:aws:cloudformation:eu-west-1:899719272550:stack/aws-sam-cli-managed-default/* because no identity-based policy allows the cloudformation:CreateChangeSet action 

你能帮我修一下吗?

提前致谢

迟到总比不到好。 你的问题的答案就在你的问题本身。

SAM cli使用您在使用aws configure命令配置aws cli时设置的AWS 凭证/角色 如果您不知道我在说什么,请在此处查看设置 AWS 凭证

不用说,这个角色需要至少具有以下一组权限才能成功创建/更新 cloudformation 堆栈。

  • cloudformation:CreateChangeSet
  • cloudformation:CreateStack
  • cloudformation:DeleteStack
  • cloudformation:DescribeChangeSet
  • cloudformation:DescribeStackEvents
  • cloudformation:DescribeStacks
  • cloudformation:ExecuteChangeSet
  • cloudformation:GetTemplateSummary
  • cloudformation:ListStackResources
  • cloudformation:UpdateStack

您正在使用的角色当前缺少cloudformation:CreateChangeSet权限,因此它失败了。 尝试将上述所有权限添加到您的角色并重新部署应用程序。

参考:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM