--- AWSTemplateFormatVersion: '2010-09-09' Description: Creates a new Lambda Function. Resources: Function: Type: 'AWS::Lambda::Function' Properties: Code: ZipFile: !Sub | def handler(event, context): print "Hello World" Description: Basic sample lambda function Handler: index.handler MemorySize: 1024 Role: !GetAtt - LambdaExecutionRole - Arn Runtime: python2.7 Timeout: 10 LambdaExecutionRole: 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:CreateLogGroup' - 'logs:CreateLogStream' - 'logs:PutLogEvents' Resource: '*' SetSecurityPartition: Type: Custom::SetSecurityPartition DependsOn: Function Properties: ServiceToken: !ImportValue PartitionPhaseAFunctionArn Outputs: FunctionName: Description: The name of the lambda function Value: !Ref Function