-
Notifications
You must be signed in to change notification settings - Fork 347
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
Add event definitions for CloudFormation custom resources #695
Conversation
Thanks for adding those events!
I'm hesitate to add more crates to this repository. I personally don't know much about CFN, so I would not be able to maintain that code. It'd probably be better if you want to create it and maintain it on your own. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you review the errors and fix them? 🙏
@calavera Done - I've removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one more fix:
error: use of deprecated method `chrono::TimeZone::datetime_from_str`: use `DateTime::parse_from_str` instead
--> lambda-events/src/custom_serde/codebuild_time.rs:21:13
|
21 | Utc.datetime_from_str(val, CODEBUILD_TIME_FORMAT)
| ^^^^^^^^^^^^^^^^^
@calavera This doesn't appear to be related to my changes - would you still like me to fix it in this PR? |
@calavera pushed a fix for this - please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Issue #, if available:
Related to #680 - see below
Description of changes:
This PR adds event definitions for CloudFormation custom resource request objects. Requests are either a Create, Update, or Delete event, implemented as enum variants with internally tagged representation.
Note that, in addition to the fields documented in the links above, in practice CloudFormation sends a
ServiceToken
field in every request. Since this isn't documented I've encoded it as anOption<String>
with#[serde(default)]
, so deserialisation will tolerate it being missing, but I can change this if desired.This is intended as an initial building block of a framework for implementing Lambda custom resource handlers, of the kind requested in #680. These work by invoking a Lambda with one of the above event types, all of which include an S3 presigned URL to which a response must be posted. Failing to post a response can result in long delays, so tools to make it easy to send a response, and a fallback mechanism to send a failure response if the Lambda is about to time out, are desirable.
I'd appreciate feedback on whether further PRs to add this functionality (probably in a
lambda_cfn
crate) would be appreciated, but either way I think the event definitions are a useful addition.By submitting this pull request