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

(custom-resources): AwsCustomResource has an unnecessary risk of responses being too large #28145

Open
rix0rrr opened this issue Nov 27, 2023 · 0 comments
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources bug This issue is a bug. effort/medium Medium work item – several days of effort p1

Comments

@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 27, 2023

Describe the bug

Observed in #28108 (temporary fix: #28112)

The AwsCustomResource custom resource posts the entire response object to CloudFormation, which can exceed the maximum size of a response object.

The workaround that has been invented previously is to have the user declare using outputPaths exactly what paths to include in the response so that we can stay within the maximum size.

This puts a burden on the user that is fully unnecessary: the AwsCustomResource can know beforehand exactly which fields are required, because it knows exactly what resource.getAttString() calls are being expected of it.

This behavior should be automatic, and not come down to user input (because users will forget, which will lead to the linked issue).

Expected Behavior

AwsCustomResource should determine its fields to respond automatically.

Current Behavior

The construct library author needs to remember that responses can become too large, and when they add a call to resource.getAttString() they have to remember to update outputPaths in the custom resource.

Reproduction Steps

Possible Solution

We should fill the list of outputPaths automatically from the calls to getAttString().

The outputPaths property should become a single top-level property, and be removed from the AwsApiCall structure as well. It doesn't make sense that the values can be different for CREATE and UPDATE, that's not how CloudFormation works.

Additional Information/Context

No response

CDK CLI Version

Framework Version

No response

Node.js Version

OS

Language

TypeScript

Language Version

No response

Other information

No response

@rix0rrr rix0rrr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 27, 2023
@github-actions github-actions bot added the @aws-cdk/custom-resources Related to AWS CDK Custom Resources label Nov 27, 2023
@pahud pahud added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources bug This issue is a bug. effort/medium Medium work item – several days of effort p1
Projects
None yet
Development

No branches or pull requests

2 participants