You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying an API using type-safe-api with a really large integrations object the PrepareSpecCustomResource fail with 413 because of large payload in input
Error:
1115107 byte payload is too large for the Event invocation type (limit 262144 bytes) (Service: AWSLambda; Status Code: 413; Error Code: RequestEntityTooLargeException; Request ID: 9f16fddd-3500-4106-aba5-07d6398ba67d; Proxy: null)
Expected Behavior
The PrepareSpecCustomResource process integrations successfully and deploy continue
Current Behavior
The PrepareSpecCustomResource fail and stop the deploy
Reproduction 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 TS
In the construct myapi.ts add the following constant and functions in order to create huge integration template responses
Then in constructor 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)
Then in super.integrations create a lot of integration with similar props (you'll need to create in the OpenAPI spec a lot of fake route in order to do that)
and in prepareSpecOptions integrations and everything else about the api is passed directly, so in a context of a large integrations 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:
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.
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: