Skip to content

Instantly share code, notes, and snippets.

@cyrilchampier
Created April 6, 2017 15:07
Show Gist options
  • Save cyrilchampier/caafdd5ab0dc03755a6fc59e862ffee1 to your computer and use it in GitHub Desktop.
Save cyrilchampier/caafdd5ab0dc03755a6fc59e862ffee1 to your computer and use it in GitHub Desktop.
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: [ lambda.amazonaws.com ]
Action: [ 'sts:AssumeRole' ]
Policies:
- PolicyName: lambdalogtocloudwatch
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: [ 'logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents' ]
Resource: 'arn:aws:logs:*:*:*'
DomainsLambda:
Type: AWS::Lambda::Function
Properties:
Code:
ZipFile: !Sub |
var response = require('cfn-response');
exports.handler = function(event, context) {
var responseData = {
ManagerDomain: "hoyeah-${AWS::StackName}",
Email: "email"
};
response.send(event, context, response.SUCCESS, responseData);
};
Handler: index.handler
Runtime: nodejs4.3
Timeout: 30
Role: !GetAtt LambdaExecutionRole.Arn
DomainsDefinition:
Type: Custom::LambdaCallout
Properties:
ServiceToken: !GetAtt DomainsLambda.Arn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment