Last active
May 29, 2022 13:57
-
-
Save efi-mk/8f313bc1b23661a3a842828725e86b77 to your computer and use it in GitHub Desktop.
Create a Lambda via CloudFormation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Template for Lambda Sample. | |
Outputs: | |
LambdaRoleARN: | |
Description: Role for Lambda execution. | |
Value: | |
Fn::GetAtt: | |
- LambdaRole | |
- Arn | |
Export: | |
Name: | |
Fn::Sub: LambdaRole | |
LambdaFunctionName: | |
Value: | |
Ref: LambdaFunction | |
LambdaFunctionARN: | |
Description: Lambda function ARN. | |
Value: | |
Fn::GetAtt: | |
- LambdaFunction | |
- Arn | |
Export: | |
Name: | |
Fn::Sub: LambdaARN-dev | |
Resources: | |
LambdaRole: | |
Type: AWS::IAM::Role | |
Properties: | |
RoleName: | |
Fn::Sub: lambda-role | |
AssumeRolePolicyDocument: | |
Statement: | |
- Action: | |
- sts:AssumeRole | |
Effect: Allow | |
Principal: | |
Service: | |
- lambda.amazonaws.com | |
Version: 2012-10-17 | |
ManagedPolicyArns: | |
- arn:aws:iam::aws:policy/AWSLambdaExecute | |
- arn:aws:iam::aws:policy/AmazonS3FullAccess | |
- arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess | |
- arn:aws:iam::aws:policy/AmazonKinesisFullAccess | |
Path: / | |
LambdaFunction: | |
Type: AWS::Lambda::Function | |
Properties: | |
FunctionName: | |
Fn::Sub: lambda-function-dev | |
Description: LambdaFunction of nodejs14.x. | |
Runtime: nodejs14.x | |
Code: | |
ZipFile: | |
"exports.handler = function(event, context){\n | |
var sample = sample;" | |
Handler: lambda-handler | |
MemorySize: 128 | |
Timeout: 10 | |
Role: | |
Fn::GetAtt: | |
- LambdaRole | |
- Arn | |
Environment: | |
Variables: | |
ENV: dev | |
TZ: UTC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment