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

问题描述 投票:0回答:1

我正在通过cloudformation和lambda函数创建一个emr集群。创建堆栈后,当我运行lambda函数时,它将通过赋予EMR服务角色来启动群集:is invalid error。我的服务角色和工作流程角色代码已随附。我缺少什么权限,或者应该授予该权限,以便我的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: /    
amazon-web-services aws-lambda permissions amazon-cloudformation amazon-emr
1个回答
0
投票

基于评论,解决方案是用作elasticmapreduce.amazonaws.com信任策略原理。

© www.soinside.com 2019 - 2024. All rights reserved.