-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
New Router: CloudFormation Custom Resource #1268
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: David Wells <hello@davidwells.io>
if (typeof handler !== 'undefined') { | ||
const response = handler(event, context, abort) | ||
response.Status ??= 'SUCCESS' | ||
response.RequestId ??= event.RequestId | ||
response.LogicalResourceId ??= event.LogicalResourceId | ||
response.StackId ??= event.StackId | ||
return response | ||
} |
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.
It would be nice if it also reported to the responseUrl, I feel like even though the abstraction is nice, it doesn't really add that much value currently as it's still the responsibility of the developer to correctly handle all errors and respond.
The auto reporting implementation is more what I was looking for honestly
return (event, context, abort) => { | ||
const { RequestType: requestType } = event | ||
if (!requestType) { | ||
return notFoundResponse({ requestType }) |
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.
I would for example expect that here we report to cloudformation that we have a failure, because if we don't do that cloudformation will simply wait x time until it timeouts whilst we already know that we won't be handling the request
#1260