cf-templates/template-workshops-setup.yaml [270:332]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
         Code: 
            ZipFile: |
               from __future__ import print_function
            
               # This is the lambda origin behing the application load balancer
               def lambda_handler(event, context):
                  response = {
                    "statusCode": 200,
                    "statusDescription": "200 OK",
                    "isBase64Encoded": False,
                    "headers": {
                    "Content-Type": "text/html; charset=utf-8"
                    }
                  }
                  
                  response['body'] = """<html>
                  <head>
                  <title>Hello World!</title>
                  <style>
                  html, body {
                  margin: 0; padding: 0;
                  font-family: arial; font-weight: 700; font-size: 3em;
                  text-align: center;
                  }
                  </style>
                  </head>
                  <body>
                  <p>Hello World!</p>
                  </body>
                  </html>"""
                  
                  return response
   
   # We will use admin privileges for now and make it least privilege as we learn
   LambdaOriginRole:
      Type : AWS::IAM::Role
      Properties:
         RoleName: 'acmcalblambdaoriginrole'
         AssumeRolePolicyDocument: 
           Version: "2012-10-17"
           Statement: 
             - 
               Effect: "Allow"
               Principal: 
                 Service: 
                   - "lambda.amazonaws.com"
               Action: 
                 - "sts:AssumeRole"
         
   # We will use admin privileges for now and make it least privilege as we learn
   LambdaOriginPolicy:
      Type : AWS::IAM::Policy
      Properties: 
         PolicyName : 'acm-alb-lambdaorigin-policy'
         PolicyDocument : 
            Version: "2012-10-17"
            Statement:
              -
               Effect: "Allow"
               Action: "*"
               Resource: "*"
         Roles:
            - !Ref LambdaOriginRole
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



site/usecase-7/cf-templates/template-app-dev.yaml [222:284]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
         Code: 
            ZipFile: |
               from __future__ import print_function
            
               # This is the lambda origin behing the application load balancer
               def lambda_handler(event, context):
                  response = {
                    "statusCode": 200,
                    "statusDescription": "200 OK",
                    "isBase64Encoded": False,
                    "headers": {
                    "Content-Type": "text/html; charset=utf-8"
                    }
                  }
                  
                  response['body'] = """<html>
                  <head>
                  <title>Hello World!</title>
                  <style>
                  html, body {
                  margin: 0; padding: 0;
                  font-family: arial; font-weight: 700; font-size: 3em;
                  text-align: center;
                  }
                  </style>
                  </head>
                  <body>
                  <p>Hello World!</p>
                  </body>
                  </html>"""
                  
                  return response
   
   # We will use admin privileges for now and make it least privilege as we learn
   LambdaOriginRole:
      Type : AWS::IAM::Role
      Properties:
         RoleName: 'acmcalblambdaoriginrole'
         AssumeRolePolicyDocument: 
           Version: "2012-10-17"
           Statement: 
             - 
               Effect: "Allow"
               Principal: 
                 Service: 
                   - "lambda.amazonaws.com"
               Action: 
                 - "sts:AssumeRole"
         
   # We will use admin privileges for now and make it least privilege as we learn
   LambdaOriginPolicy:
      Type : AWS::IAM::Policy
      Properties: 
         PolicyName : 'acm-alb-lambdaorigin-policy'
         PolicyDocument : 
            Version: "2012-10-17"
            Statement:
              -
               Effect: "Allow"
               Action: "*"
               Resource: "*"
         Roles:
            - !Ref LambdaOriginRole
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



