(custom-resources): AwsCustomResource has an unnecessary risk of responses being too large #28145
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
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 whatresource.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 updateoutputPaths
in the custom resource.Reproduction Steps
Possible Solution
We should fill the list of
outputPaths
automatically from the calls togetAttString()
.The
outputPaths
property should become a single top-level property, and be removed from theAwsApiCall
structure as well. It doesn't make sense that the values can be different forCREATE
andUPDATE
, 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
The text was updated successfully, but these errors were encountered: