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

New Router: CloudFormation Custom Resource #1268

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

willfarrell
Copy link
Member

Copy link

socket-security bot commented Dec 13, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@airbnb/[email protected] Transitive: environment, filesystem +3 1.19 MB milesj
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +69 2.56 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +69 2.58 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +75 4.78 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +95 6.34 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +70 3.04 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +70 3.08 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +71 3.12 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +71 6.12 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +69 2.86 MB aws-sdk-bot
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, shell +73 3.09 MB aws-sdk-bot
npm/@aws-sdk/[email protected] None +1 146 kB aws-sdk-bot
npm/@commitlint/[email protected] Transitive: environment, filesystem, shell, unsafe +89 7.34 MB escapedcat
npm/@commitlint/[email protected] Transitive: filesystem +10 2.5 MB escapedcat
npm/@datastream/[email protected] Transitive: environment +11 806 kB willfarrell
npm/@fastify/[email protected] None 0 80.1 kB gurgunday
npm/@middy/[email protected] None 0 17.6 kB lmammino
npm/@middy/[email protected] None 0 5.48 kB lmammino
npm/@middy/[email protected] None 0 19.4 kB lmammino
npm/@middy/[email protected] None 0 9.23 kB lmammino
npm/@serverless/[email protected] None +2 2.32 MB aj.stuyvenberg
npm/@types/[email protected] None 0 167 kB types
npm/@types/[email protected] None +1 2.3 MB types
npm/[email protected] None 0 4.9 kB bolamn
npm/[email protected] Transitive: environment, filesystem, network +8 1.56 MB willfarrell
npm/[email protected] None 0 53.2 kB esp
npm/[email protected] Transitive: filesystem, shell +12 942 kB additiveamateur
npm/[email protected] None 0 56.8 kB jason-green
npm/[email protected] Transitive: environment, filesystem, shell +20 970 kB willfarrell
npm/[email protected] environment, network +1 185 kB jaredcnance
npm/[email protected] Transitive: environment, eval +18 8.02 MB m-radzikowski
npm/[email protected] Transitive: environment, filesystem, network, unsafe +41 3.94 MB awsxray
npm/[email protected] environment, filesystem, network, shell +24 245 MB evanw
npm/[email protected] None 0 4.04 kB typicode
npm/[email protected] None 0 27.2 kB nemtsov
npm/[email protected] Transitive: environment, filesystem, shell +54 2.25 MB okonet
npm/[email protected] None 0 28.7 kB wesleytodd
npm/[email protected] None 0 7.83 MB prettier-bot
npm/[email protected] None 0 129 kB aslemammad
npm/[email protected] Transitive: environment, eval, filesystem, shell, unsafe +283 26.5 MB linusu
npm/[email protected] Transitive: environment, filesystem +108 50.1 MB sindresorhus
npm/[email protected] None 0 400 kB sindresorhus
npm/[email protected] None 0 22.7 MB typescript-bot

🚮 Removed packages: npm/@docusaurus/[email protected], npm/@docusaurus/[email protected], npm/@docusaurus/[email protected], npm/@docusaurus/[email protected], npm/@docusaurus/[email protected], npm/@mdx-js/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

@willfarrell willfarrell changed the title Feature/cloudformation custom resource router New Router: CloudFormation Custom Resource Dec 13, 2024
@willfarrell willfarrell marked this pull request as draft December 13, 2024 16:38
Comment on lines +32 to +39
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
}

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 })

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

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

Successfully merging this pull request may close these issues.

3 participants