PreLab/central-template-environment-setup.yaml [536:627]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Handler: index.handler
      Role: !GetAtt HandleMasterLifecycleEventsRole.Arn
      Runtime: python3.7
      Timeout: 120

  HandleMasterLifecycleEventsSnsSubscription:
    Type: AWS::SNS::Subscription
    Condition: LifecycleTopicIsNotEmpty
    Properties:
      Endpoint: !GetAtt HandleMasterLifecycleEventsFunction.Arn
      Protocol: lambda
      TopicArn: !Ref EELifecycleTopicArn

  HandleMasterLifecycleEventsPermissionForSns:
    Type: AWS::Lambda::Permission
    Condition: LifecycleTopicIsNotEmpty
    Properties:
      Action: lambda:InvokeFunction
      Principal: sns.amazonaws.com
      SourceArn: !Ref EELifecycleTopicArn
      FunctionName: !Ref HandleMasterLifecycleEventsFunction

  HandleMasterLifecycleEventsRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
        - Effect: Allow
          Principal:
            Service:
            - lambda.amazonaws.com
          Action:
          - sts:AssumeRole
      Path: "/"
      Policies:
      - PolicyName: root
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
          - Effect: Allow
            Action:
            - logs:*
            Resource: arn:aws:logs:*:*:*
          - Effect: Allow
            Action:
            - lambda:invokeFunction
            Resource: arn:aws:lambda:*:*:*
  #------------------------------------------------------------------------------#
  # FUNCTION TO SEND OUTPUTS TO EVENT ENGINE VIA AN API CALL
  #------------------------------------------------------------------------------#
  SendTeamOutputToEventEngineFunction:
    Type: AWS::Lambda::Function
    Properties:
      Code:
        S3Bucket: !Ref EEAssetsBucket
        S3Key: !Sub "modules/${EEModuleId}/v${EEModuleVersion}/lambda/send-team-output-to-event-engine.zip"
      Description: Sends team outputs to Event Engine.
      Environment:
        Variables:
          API_BASE: !Ref EEAPIBase
          API_TOKEN: !Ref EEAPIToken
          EVENT_REGION: !Ref AWS::Region
          EVENT_ID: !Ref EEEventId
          MODULE_ID: !Ref EEModuleId
      Handler: index.handler
      Role: !GetAtt SendOutputToEventEngineRole.Arn
      Runtime: python3.7
      Timeout: 120

  SendOutputToEventEngineRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
        - Effect: Allow
          Principal:
            Service:
            - lambda.amazonaws.com
          Action:
          - sts:AssumeRole
      Path: "/"
      Policies:
      - PolicyName: root
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
          - Effect: Allow
            Action:
            - logs:*
            Resource: arn:aws:logs:*:*:*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



PreLab/central-template-glue-databrew.yaml [147:238]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Handler: index.handler
      Role: !GetAtt HandleMasterLifecycleEventsRole.Arn
      Runtime: python3.7
      Timeout: 120

  HandleMasterLifecycleEventsSnsSubscription:
    Type: AWS::SNS::Subscription
    Condition: LifecycleTopicIsNotEmpty
    Properties:
      Endpoint: !GetAtt HandleMasterLifecycleEventsFunction.Arn
      Protocol: lambda
      TopicArn: !Ref EELifecycleTopicArn

  HandleMasterLifecycleEventsPermissionForSns:
    Type: AWS::Lambda::Permission
    Condition: LifecycleTopicIsNotEmpty
    Properties:
      Action: lambda:InvokeFunction
      Principal: sns.amazonaws.com
      SourceArn: !Ref EELifecycleTopicArn
      FunctionName: !Ref HandleMasterLifecycleEventsFunction

  HandleMasterLifecycleEventsRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
        - Effect: Allow
          Principal:
            Service:
            - lambda.amazonaws.com
          Action:
          - sts:AssumeRole
      Path: "/"
      Policies:
      - PolicyName: root
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
          - Effect: Allow
            Action:
            - logs:*
            Resource: arn:aws:logs:*:*:*
          - Effect: Allow
            Action:
            - lambda:invokeFunction
            Resource: arn:aws:lambda:*:*:*
  #------------------------------------------------------------------------------#
  # FUNCTION TO SEND OUTPUTS TO EVENT ENGINE VIA AN API CALL
  #------------------------------------------------------------------------------#
  SendTeamOutputToEventEngineFunction:
    Type: AWS::Lambda::Function
    Properties:
      Code:
        S3Bucket: !Ref EEAssetsBucket
        S3Key: !Sub "modules/${EEModuleId}/v${EEModuleVersion}/lambda/send-team-output-to-event-engine.zip"
      Description: Sends team outputs to Event Engine.
      Environment:
        Variables:
          API_BASE: !Ref EEAPIBase
          API_TOKEN: !Ref EEAPIToken
          EVENT_REGION: !Ref AWS::Region
          EVENT_ID: !Ref EEEventId
          MODULE_ID: !Ref EEModuleId
      Handler: index.handler
      Role: !GetAtt SendOutputToEventEngineRole.Arn
      Runtime: python3.7
      Timeout: 120

  SendOutputToEventEngineRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
        - Effect: Allow
          Principal:
            Service:
            - lambda.amazonaws.com
          Action:
          - sts:AssumeRole
      Path: "/"
      Policies:
      - PolicyName: root
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
          - Effect: Allow
            Action:
            - logs:*
            Resource: arn:aws:logs:*:*:*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



