【问题标题】:AWS Code Pipeline root is not authorized to perform: iam:PassRoleAWS Code Pipeline 根无权执行:iam:PassRole
【发布时间】:2021-12-08 20:44:55
【问题描述】:

我正在为一项任务而苦苦挣扎。我想创建一个角色并为他们分配一个策略。我正在使用 .yaml 模板来创建它。我想通过 CodePipeline 执行此操作-> 我在那里选择 CloudFormation 作为部署操作提供程序。每次当我想创建管道时,我都会收到错误:root 无权执行:iam:PassRole。你能帮忙吗? 这是我的 template.yaml

AWSTemplateFormatVersion: "2010-09-09"


Parameters:
    RolesName:
        Description: Entere role name
        Type: String

Resources:
  RootRole:
    Type: 'AWS::IAM::Role'
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: Allow
            Principal:
              Service:
                - s3.amazonaws.com
            Action:
              - 'sts:AssumeRole'
      Path: /
      Policies:
        - PolicyName: snowflake_access
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              - Effect: Allow
                Action: '*'
                Resource: '*'
      RoleName: !Ref RolesName
  RootInstanceProfile:
    Type: 'AWS::IAM::InstanceProfile'
    Properties:
      Path: /
      Roles:
        - !Ref RolesName

【问题讨论】:

  • 完整的错误信息是什么?哪个资源失败? root是谁?
  • 附加到您的 CodePipeline 的 IAM 角色是什么样的?
  • 角色名称资源失败,我在 root 帐户中执行此操作。所以基本上我想创建一个模板文件,我可以在其中创建一个新角色并将策略分配给这个角色。在上面你可以看到一个模板。我也想通过 CodePipeline -> CloudFormation 做到这一点

标签: yaml amazon-cloudformation aws-codepipeline


【解决方案1】:

您有 S3 作为您的 Principal,您需要将其更改为 codepipeline

      Principal:
          Service:
            - codepipeline.amazonaws.com

【讨论】:

  • 感谢您的回复,但这根本没有帮助。还是一样的问题:(
猜你喜欢
  • 2021-10-14
  • 2019-01-25
  • 2019-01-22
  • 1970-01-01
  • 2021-11-28
  • 1970-01-01
  • 2015-02-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多