aws-servicecatalog-prescriptivecompliance/cft/aws-servicecatalog-prescriptivecompliance-v1.yml [337:395]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      EnableLogFileValidation: false
      S3BucketName: 
        Ref: SCS3MisconfiguredCloudTrailBucket
      IsLogging: true
      IsMultiRegionTrail: false

  MisconfiguredEIP:
    Type: AWS::EC2::EIP
    Properties:
      Domain: vpc


#------------------------------------------------------------------------------------------
# On Demand Config Evaluation Lambda for AWS Config Rules:
#  -- Provides a live game experience to the user
#  -- Triggers Detection at 2 min intervals of misconfigured resources via AWS Config
#-------------------------------------------------------------------------------------------
  
  OnDemandConfigEvalEventRule: 
    Type: AWS::Events::Rule
    Properties: 
      Name: OnDemandConfigEvalEventRule
      Description: "Trigger On Demand Evaluation of Config Rules for Game Day"
      State: "ENABLED"
      ScheduleExpression: "rate(2 minutes)"
      Targets: 
        - 
          Arn: 
            Fn::GetAtt: 
              - "OnDemandConfigEvalLambda"
              - "Arn"
          Id: "OnDemandConfigEval"

  PermissionForEventsToInvokeConfigLambda:
    Type: AWS::Lambda::Permission
    Properties:
      Action: lambda:InvokeFunction
      FunctionName: !GetAtt "OnDemandConfigEvalLambda.Arn"
      Principal: events.amazonaws.com
      SourceArn: !GetAtt "OnDemandConfigEvalEventRule.Arn"

  OnDemandConfigEvalLambda:
    Type: AWS::Lambda::Function
    Properties:
      Code:
        ZipFile: |
          import json
          import os
          import boto3
          import logging
          LOGGER = logging.getLogger()
          LOGGER.setLevel(logging.INFO)
          def lambda_handler(event, context):
              try:
                  ruleName1 = os.environ['ruleName1']
                  ruleName2 = os.environ['ruleName2']
                  ruleName3 = os.environ['ruleName3']
                  ruleName4 = os.environ['ruleName4']
                  ruleName5 = os.environ['ruleName5']
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-servicecatalog-prescriptivecompliance/cft/aws-servicecatalog-prescriptivecompliance.yml [330:388]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      EnableLogFileValidation: false
      S3BucketName: 
        Ref: SCS3MisconfiguredCloudTrailBucket
      IsLogging: true
      IsMultiRegionTrail: false

  MisconfiguredEIP:
    Type: AWS::EC2::EIP
    Properties:
      Domain: vpc


#------------------------------------------------------------------------------------------
# On Demand Config Evaluation Lambda for AWS Config Rules:
#  -- Provides a live game experience to the user
#  -- Triggers Detection at 2 min intervals of misconfigured resources via AWS Config
#-------------------------------------------------------------------------------------------
  
  OnDemandConfigEvalEventRule: 
    Type: AWS::Events::Rule
    Properties: 
      Name: OnDemandConfigEvalEventRule
      Description: "Trigger On Demand Evaluation of Config Rules for Game Day"
      State: "ENABLED"
      ScheduleExpression: "rate(2 minutes)"
      Targets: 
        - 
          Arn: 
            Fn::GetAtt: 
              - "OnDemandConfigEvalLambda"
              - "Arn"
          Id: "OnDemandConfigEval"

  PermissionForEventsToInvokeConfigLambda:
    Type: AWS::Lambda::Permission
    Properties:
      Action: lambda:InvokeFunction
      FunctionName: !GetAtt "OnDemandConfigEvalLambda.Arn"
      Principal: events.amazonaws.com
      SourceArn: !GetAtt "OnDemandConfigEvalEventRule.Arn"

  OnDemandConfigEvalLambda:
    Type: AWS::Lambda::Function
    Properties:
      Code:
        ZipFile: |
          import json
          import os
          import boto3
          import logging
          LOGGER = logging.getLogger()
          LOGGER.setLevel(logging.INFO)
          def lambda_handler(event, context):
              try:
                  ruleName1 = os.environ['ruleName1']
                  ruleName2 = os.environ['ruleName2']
                  ruleName3 = os.environ['ruleName3']
                  ruleName4 = os.environ['ruleName4']
                  ruleName5 = os.environ['ruleName5']
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



