Created
August 26, 2016 05:27
-
-
Save mweagle/932c92b58c2d8c2075c3d929d210b99e to your computer and use it in GitHub Desktop.
Spartav0.8.0_newLambda
This file contains hidden or 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
// Setup an IAM role that allows the lambda function to send a message | |
// to the queue. | |
iamPolicy := sparta.IAMRoleDefinition{ | |
Privileges: []sparta.IAMRolePrivilege{ | |
sparta.IAMRolePrivilege{ | |
Actions: []string{ | |
"sqs:SendMessage"}, | |
Resource: gocf.GetAtt(sqsResourceName, "Arn").String(), | |
}, | |
}, | |
} | |
// The actual lambda functions | |
lambdaFn := sparta.NewLambda(iamPolicy, | |
helloWorldLambda, | |
nil) | |
lambdaFn.Decorator = helloWorldDecorator | |
lambdaFn.DependsOn = []string{sqsResourceName} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment