Created
April 6, 2017 15:07
-
-
Save cyrilchampier/caafdd5ab0dc03755a6fc59e862ffee1 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
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