为什么AWS CodeDeploy给了我一个具有pipe理员权限的帐户的AccessDeniedException?

我试图从CLI创build一个AWS部署组,我得到以下错误:

An error occurred (AccessDeniedException) when calling the CreateDeploymentGroup operation: User: <redacted> is not authorized to perform: iam:PassRole on resource: arn:aws:codedeploy:us-east-1:<redacted>:<redacted> 

我这样做的用户帐户具有AdministratorAccess权限,所以我难以理解为什么该帐户没有被授权这样做。 我怎样才能解决这个问题?

您需要设置“信任关系”,以便CodeDeploy具有承担angular色的权限。

在这个链接从第8步开始,并检查您的configuration。

CodeDeploy信任关系

我终于明白了什么是错误的:我没有正确地指定一个服务angular色。 看到这里如何做到这一点。 一旦您创build了具有所需权限的服务angular色,您就需要获取该angular色的ARN才能引用它。