-
Notifications
You must be signed in to change notification settings - Fork 420
Feature request: Parser support for custom resource #2295
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
Comments
I can work on it later this month if that's ok with you |
For reference: typed structs from Go: https://github.com/aws/aws-lambda-go/blob/771b391678d3f54bfa38531774d656f5e0f2ab58/cfn/event.go |
Careful here, envelope could lead to resources being deleted: aws-powertools/powertools-lambda-java#1081 [on various meetings :/ so being brief] |
@heitorlessa any unhandled exception can cause that. I think decorator usage in this case is less ideal. But regular parse function with try/except is fine. |
it's similar to my gist, but it's not accurate 100%. OldResourceProperties does not appear in create/delete events. Only in update from my experience. |
It’s more complicated than error handling only - we had a ton of issues
with custom resources in prod supporting internal teams.
I’m totally supportive of having a Parser model but not an envelope — it’s
easy to make mistakes and can be irreversible in some cases.
For custom resources, we keep a cross-link to handle these tricky scenarios
for that reason.
https://github.com/aws-cloudformation/custom-resource-helper
…On Mon, 22 May 2023 at 21:01, Ran Isenberg ***@***.***> wrote:
For reference: typed structs from Go:
https://github.com/aws/aws-lambda-go/blob/771b391678d3f54bfa38531774d656f5e0f2ab58/cfn/event.go
it's similar to my gist, but it's not accurate 100%. OldResourceProperties
does not appear in create/delete events. Only in update from my experience.
—
Reply to this email directly, view it on GitHub
<#2295 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBEYKQBI5ZU5XO5Q55DXHOZZ5ANCNFSM6AAAAAAYHM6I3E>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@heitorlessa np, then model it is. |
Hi @ran-isenberg! So in this case, can you send the PR to add this support? We are planning to release a version on Friday, so if you can send the PR by then we can include it in the next version, if not we will include it in the next release. Thank you! |
|
Use case
CFN Custom resource can trigger a lambda function with a set of events: create, delete and update.
There's a clear envelope and user payload which makes it a classic candidate for the parser.
I printed the actual events and wrote an event generator for testing purposes in my own application.
here's the gist: https://gist.github.com/ran-isenberg/9a49fad3d607245f7d615696353d1a36
Solution/User Experience
Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: