From 87cf5d7b4e3bf1e0a0db48a3e3e4f95cc7bdc6a3 Mon Sep 17 00:00:00 2001 From: Tom Night Date: Thu, 23 Jul 2020 17:29:36 -0400 Subject: [PATCH] Create template2.yaml --- templates/template2.yaml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 templates/template2.yaml diff --git a/templates/template2.yaml b/templates/template2.yaml new file mode 100644 index 0000000..2cf57b3 --- /dev/null +++ b/templates/template2.yaml @@ -0,0 +1,48 @@ +AWSTemplateFormatVersion: 2010-09-09 +Description: Multi-Region Infrastructure Deployment Lambda Example +Parameters: + TestEnv: + Type: String + +Resources: + TestLambda: + Type: AWS::Lambda::Function + Properties: + Description: Test lambda + Handler: index.handler + Role: !GetAtt TestRole.Arn + Runtime: nodejs12.x + MemorySize: 128 + Timeout: 10 + Code: + ZipFile: | + exports.handler = async (event) => { + console.log('hello world'); + }; + Environment: + Variables: + TEST: !Ref TestEnv + + TestRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Principal: + Service: lambda.amazonaws.com + Action: sts:AssumeRole + Path: / + Policies: + - PolicyName: TestPolicy + PolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Action: + - logs:CreateLogGroup + - logs:CreateLogStream + - logs:PutLogEvents + Resource: + - !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/*