繁体   English   中英

创建EMR集群出错,EMR服务角色无效

[英]Error when creating EMR cluster, EMR service role is invalid

我正在通过 cloudformation 和 lambda function 创建一个 emr 集群。创建堆栈后,当我运行 lambda function 时,它通过提供 EMR 服务角色来启动集群:无效错误。 附上我的服务角色和工作流程角色代码。 这是我缺少的权限,或者我应该给予的权限,以便我的 emr 开始执行这些步骤。

EMRClusterServiceRole:
    Type: 'AWS::IAM::Role'
    Properties:
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
        - Effect: Allow
          Principal:
            Service:
            - ec2.amazonaws.com
          Action:
          - 'sts:AssumeRole'
      ManagedPolicyArns:
            - arn:aws:iam::aws:policy/service-role/AmazonElasticMapReduceforEC2Role
      Path: /

  EMRClusterinstanceProfileRole: 
    Type: 'AWS::IAM::Role'
    Properties:
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
        - Effect: Allow
          Principal: 
            Service: 
            - ec2.amazonaws.com
          Action: 
          - 'sts:AssumeRole'
      ManagedPolicyArns: 
        - arn:aws:iam::aws:policy/service-role/AmazonElasticMapReduceforEC2Role
      Path: /

  EMRClusterinstanceProfile:
    Type: AWS::IAM::InstanceProfile
    Properties:
      Path: /
      Roles:
      - !Ref EMRClusterinstanceProfileRole

  EMRJobFlowProfileinstance: 
    Type: AWS::IAM::InstanceProfile
    Properties:
      Path: /
      Roles:
      - !Ref EMRJobFlowRole


  EMRJobFlowRole:       
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: 2012-10-17
        Statement:
        - Effect: Allow
          Principal: 
            Service: 
            - ec2.amazonaws.com
          Action: 
          - 'sts:AssumeRole'
      ManagedPolicyArns: 
        - arn:aws:iam::aws:policy/service-role/AmazonElasticMapReduceforEC2Role
      Path: /    

根据评论,解决方案是使用elasticmapreduce.amazonaws.com信任策略原则。

暂无
暂无

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

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