Skip to content

Commit

Permalink
Create template2.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
tomnight authored Jul 23, 2020
1 parent 3efaa45 commit 87cf5d7
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions templates/template2.yaml
Original file line number Diff line number Diff line change
@@ -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/*

0 comments on commit 87cf5d7

Please sign in to comment.