content/lab_assets/start/lab1/cfn-project/templates/lab1.template.yaml [21:55]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Resources:
  LambdaExecutionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
        - Effect: Allow
          Principal:
            Service:
            - lambda.amazonaws.com
          Action:
          - sts:AssumeRole
      Path: "/"
      ManagedPolicyArns:
      - "arn:aws:iam::aws:policy/AWSLambdaExecute"
  GenRandomLambda:
    Type: AWS::Lambda::Function
    Properties:
      Description: Lambda creates simple random string
      Handler: lambda_function.handler
      Runtime: python3.7
      Role: !GetAtt 'LambdaExecutionRole.Arn'
      Timeout: 300
      Code:
        S3Bucket: !Ref 'S3BucketName'
        S3Key: !Sub '${S3KeyPrefix}lambda_functions/packages/GenRandom/lambda.zip'
  StringGenerator:
    DeletionPolicy: Retain
    Type: AWS::CloudFormation::CustomResource
    Properties:
      ServiceToken: !GetAtt GenRandomLambda.Arn
      Length: 12
Outputs:
  GeneratedRandomString:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



content/lab_assets/start/lab2/cfn-project/templates/lab2.template.yaml [28:62]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Resources:
  LambdaExecutionRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
        - Effect: Allow
          Principal:
            Service:
            - lambda.amazonaws.com
          Action:
          - sts:AssumeRole
      Path: "/"
      ManagedPolicyArns:
      - "arn:aws:iam::aws:policy/AWSLambdaExecute"
  GenRandomLambda:
    Type: AWS::Lambda::Function
    Properties:
      Description: Lambda creates simple random string
      Handler: lambda_function.handler
      Runtime: python3.7
      Role: !GetAtt 'LambdaExecutionRole.Arn'
      Timeout: 300
      Code:
        S3Bucket: !Ref 'S3BucketName'
        S3Key: !Sub '${S3KeyPrefix}lambda_functions/packages/GenRandom/lambda.zip'
  StringGenerator:
    DeletionPolicy: Retain
    Type: AWS::CloudFormation::CustomResource
    Properties:
      ServiceToken: !GetAtt GenRandomLambda.Arn
      Length: 12
Outputs:
  GeneratedRandomString:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



