Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support subscription to SNS Topic and CloudWatch Event Rule #115

Open
brandond opened this issue Nov 15, 2016 · 0 comments
Open

Support subscription to SNS Topic and CloudWatch Event Rule #115

brandond opened this issue Nov 15, 2016 · 0 comments

Comments

@brandond
Copy link
Contributor

It would be nice if the lambda config could be extended to automatically register the Lambda with a SNS Topic, CloudWatch Event Rule, etc.

This would add two properties (events and topics) to the root JSON object, both of which should be lists:

{
  "name": "Example_Lambda",
  "description": "This is a lambda",
  "region": "us-west-2",
  "handler": "function.lambda_handler",
  "role": "arn:aws:iam::0123456789012:role/LambdaRole",
  "timeout": 30,
  "memory": 128,
  "ignore": [
    "/*.pyc",
    "lambda.json"
  ],
  "events": [
    {
      "State": "ENABLED",
      "EventPattern": "{\"detail-type\":[\"AWS API Call via CloudTrail\"],\"detail\":{\"eventSource\":[\"ec2.amazonaws.com\"],\"eventName\":[\"StartInstances\",\"RunInstances\",\"RunScheduledInstances\"]}}",
      "Name": "Example-Lambda-Trigger",
      "Description": "Triggers lambda execution"
    }
  ],
  "topics": [
    "arn:aws:sns:us-west-2:0123456789012:Example-Lambda-Topic"
  ]
}

For both use cases, the object should be created if it does not exist, and permissions should be granted as necessary to allow invocation of the lambda by the calling service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant