ml-summit-2021/code/Textract-Comprehend-A2I.yaml [477:543]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Type: "AWS::IAM::Role"
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: "Allow"
            Principal:
              Service:
                - lambda.amazonaws.com
            Action: "sts:AssumeRole"
      Path: "/"
      Policies:
        - PolicyName: "AllowInvoke"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              - Effect: "Allow"
                Action: "lambda:InvokeFunction"
                Resource: "*"
        - PolicyName: "ReadWriteToS3"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              - Effect: "Allow"
                Action:
                  - "S3:GetObject"
                  - "S3:PutObject"
                Resource: !Sub 'arn:aws:s3:::*'
              - Effect: "Allow"
                Action:
                  - "S3:ListBucket"
                Resource: !Sub 'arn:aws:s3:::*'
        - PolicyName: "SSMParameterRead"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              Effect: "Allow"
              Action:
                - "ssm:GetParameters"
                - "ssm:GetParameter"
              "Resource": "*"
        - PolicyName: "DeleteAndPutTrainingComprehendCERParameter"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              Effect: "Allow"
              Action:
                - "ssm:PutParameter"
                - "ssm:DeleteParameter"
              "Resource": "*"
        - PolicyName: "IamPassRoleForComprehend"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              Effect: "Allow"
              Action:
              - "iam:PassRole"
              - "iam:GetRole"
              Resource:
                Fn::GetAtt:
                - ComprehendExecutionRole
                - Arn
        - PolicyName: "ComprehendCreateEntityRecognizerPermission"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              Effect: "Allow"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ml-summit-2021/code/Textract-Comprehend-A2I.yaml [612:678]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Type: "AWS::IAM::Role"
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: "Allow"
            Principal:
              Service:
                - lambda.amazonaws.com
            Action: "sts:AssumeRole"
      Path: "/"
      Policies:
        - PolicyName: "AllowInvoke"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              - Effect: "Allow"
                Action: "lambda:InvokeFunction"
                Resource: "*"
        - PolicyName: "ReadWriteToS3"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              - Effect: "Allow"
                Action:
                  - "S3:GetObject"
                  - "S3:PutObject"
                Resource: !Sub 'arn:aws:s3:::*'
              - Effect: "Allow"
                Action:
                  - "S3:ListBucket"
                Resource: !Sub 'arn:aws:s3:::*'
        - PolicyName: "SSMParameterRead"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              Effect: "Allow"
              Action:
                - "ssm:GetParameters"
                - "ssm:GetParameter"
              "Resource": "*"
        - PolicyName: "DeleteAndPutTrainingComprehendCERParameter"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              Effect: "Allow"
              Action:
                - "ssm:PutParameter"
                - "ssm:DeleteParameter"
              "Resource": "*"
        - PolicyName: "IamPassRoleForComprehend"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              Effect: "Allow"
              Action:
              - "iam:PassRole"
              - "iam:GetRole"
              Resource:
                Fn::GetAtt:
                - ComprehendExecutionRole
                - Arn
        - PolicyName: "ComprehendCreateEntityRecognizerPermission"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              Effect: "Allow"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



