-
Notifications
You must be signed in to change notification settings - Fork 75
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
[BUG] (type-safe-api) PrepareSpecCustomResource fail with error 413 in large API with many integrations #771
Comments
Hi @valebedu - thanks for raising this. I agree with your proposal - would you have capacity to raise a backwards compat PR to resolve this or would you be looking for us to add this for you? The only reason I bring this up is that we won't be able to realistically add this into the AWS PDK for another couple of weeks. |
This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label. |
Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. If you wish to exclude this issue from being marked as stale, add the "backlog" label. |
Reopening this as it's still an issue. Think it still needs a bit more digging/experimentation to figure out how we can handle large APIs without hitting the CFN/lambda size limits. |
Describe the bug
When deploying an API using type-safe-api with a really large integrations object the
PrepareSpecCustomResource
fail with 413 because of large payload in inputError:
Expected Behavior
The
PrepareSpecCustomResource
process integrations successfully and deploy continueCurrent Behavior
The
PrepareSpecCustomResource
fail and stop the deployReproduction Steps
In order to reproduce the error it's pretty simple you need to make a really large integrations object and deploy this api
Here is the way I'm facing this issue in a real production scenario:
Follow the documentation in order to create the base
type-safe-api
project in TSIn the construct
myapi.ts
add the following constant and functions in order to create huge integration template responsesconstructor
create a CfnMapping in order to keep the Cloudformation Template as small as possible (this will allow to have a virtually big integrations object while keeping the cloudformation template low because it will use FindInMap)super.integrations
create a lot ofintegration
with similar props (you'll need to create in the OpenAPI spec a lot of fake route in order to do that)Possible Solution
In the
PrepareSpecCustomResource
there are several properties:and in
prepareSpecOptions
integrations and everything else about the api is passed directly, so in a context of a largeintegrations
object, the process fail everytime.A workaround could be to write all of the info into a bucket and then read the bucket.
Additional Information/Context
No response
PDK version used
v0.23.37
What languages are you seeing this issue on?
Typescript
Environment details (OS name and version, etc.)
macOS Sonoma 14.4.1 Apple M1 Pro
The text was updated successfully, but these errors were encountered: