Skip to content

Instantly share code, notes, and snippets.

@mweagle
Created August 26, 2016 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mweagle/932c92b58c2d8c2075c3d929d210b99e to your computer and use it in GitHub Desktop.
Save mweagle/932c92b58c2d8c2075c3d929d210b99e to your computer and use it in GitHub Desktop.
Spartav0.8.0_newLambda
// 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