Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for CloudWatch events to the
event_sources
block. Also includes acron
sample that demonstrates usage.I backed off of my approach of using
type
+name
, in favor of thearn
field, but I do think this approach is somewhat brittle as the user has to supply their account id in the arn and (I think) the arn needs to haverule/
in the prefix (e.g.rule/hello-cron
)But I think migration to a simplified
event_sources
format should be discussed separately, and for now I think it's ok to make this work like all the other sources.One big thing to review -- in
context.py
I added this line todeploy()
:This may be wrong, but I didn't see any path that would cause events to be registered --
create()
was calling it, but when is that method called?So I'm happy to remove that line before we merge this if that's incorrect - it will certainly impact code other than CloudWatch. But again, without that I'm not sure how any event sources will get added, but I may have missed how that works.