Created
February 4, 2016 13:44
-
-
Save davehewy/d81274923897fa84f4fd to your computer and use it in GitHub Desktop.
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", | |
"Resources": { | |
"AppendItemToListFunction": { | |
"Properties": { | |
"Code": { | |
"ZipFile": { | |
"Fn::Join": [ | |
"", | |
[ | |
"var response = require('cfn-response');", | |
"exports.handler = function(event, context) {", | |
" var responseData = {Value: event.ResourceProperties.List};", | |
" responseData.Value.push(event.ResourceProperties.AppendedItem);", | |
" response.send(event, context, response.SUCCESS, responseData);", | |
"};" | |
] | |
] | |
} | |
}, | |
"Handler": "index.handler", | |
"Role": { | |
"Fn::GetAtt": [ | |
"LambdaExecutionRole", | |
"Arn" | |
] | |
}, | |
"Runtime": "nodejs" | |
}, | |
"Type": "AWS::Lambda::Function" | |
}, | |
"LambdaExecutionRole": { | |
"Properties": { | |
"AssumeRolePolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": [ | |
"sts:AssumeRole" | |
], | |
"Effect": "Allow", | |
"Principal": { | |
"Service": [ | |
"lambda.amazonaws.com" | |
] | |
} | |
} | |
], | |
"Version": "2012-10-17" | |
}, | |
"Path": "/", | |
"Policies": [ | |
{ | |
"PolicyDocument": { | |
"Statement": [ | |
{ | |
"Action": [ | |
"logs:*" | |
], | |
"Effect": "Allow", | |
"Resource": "arn:aws:logs:*:*:*" | |
} | |
], | |
"Version": "2012-10-17" | |
}, | |
"PolicyName": "root" | |
} | |
] | |
}, | |
"Type": "AWS::IAM::Role" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment