-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
CrossRegionExportWriter: Response object is too long. #23958
Comments
The custom resource logs this, I think the
{
"Status": "FAILED",
"Reason": "ValidationException: 1 validation error detected: Value '[/cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttoryNestedStackoryNestedStackResource908720F1Outputscompanyproductjosh22apsoutheast2oryhydrahydrapublicB75FC865RefEA95D68D, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttoryNestedStackoryNestedStackResource908720F1Outputscompanyproductjosh22apsoutheast2orykratoskratosadmin66E5C2F5RefABC2E741, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttsamlfederationNestedStacksamlfederationNestedStackResourceF9BAFFEBOutputscompanyproductjosh22apsoutheast2samlfederationalb8BC22212Ref5884B1DC, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttoryNestedStackoryNestedStackResource908720F1Outputscompanyproductjosh22apsoutheast2oryhydrahydraadmin44A1DC5ARef25110A0F, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttadmingqlNestedStackadmingqlNestedStackResource7F92880AOutputscompanyproductjosh22apsoutheast2admingqlalbEF458438RefF1172A0D, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttoryNestedStackoryNestedStackResource908720F1Outputscompanyproductjosh22apsoutheast2oryproxyNestedStackproxyNestedStackResource12C3FA79Outputscompanyproductjosh22apsoutheast2oryproxyal9F2CB0FD, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttoryNestedStackoryNestedStackResource908720F1Outputscompanyproductjosh22apsoutheast2oryhydraadhydraadadmin13715108Ref123ADE30, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttmigrationNestedStackmigrationNestedStackResourceC0800D01Outputscompanyproductjosh22apsoutheast2migrationalb2B1D1A53Ref0B868277, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttoryNestedStackoryNestedStackResource908720F1Outputscompanyproductjosh22apsoutheast2orykratoskratospublicBF598F48Ref61F05EEB, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttsamlNestedStacksamlNestedStackResource2B1E690EOutputscompanyproductjosh22apsoutheast2samlalb776F7A60Ref2A2E0028, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttoryNestedStackoryNestedStackResource908720F1Outputscompanyproductjosh22apsoutheast2oryhydraadhydraadpublic8B011CFARef0C11F132, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttloginNestedStackloginNestedStackResource5E1A21F5Outputscompanyproductjosh22apsoutheast2loginalb6D8F1A33Ref5E92FD74, /cdk/exports/companyproductjosh22acc66077BB2/companyproductjosh22apsoutheast2A61AF646apsoutheast2FnGetAttactivedirectoryfederationNestedStackactivedirectoryfederationNestedStackResourceF6043CF6Outputscompanyproductjosh22apsoutheast2activedirectoryfederationalb6E7DB668Ref1F7C174D]' at 'names' failed to satisfy constraint: Member must have length less than or equal to 10\n at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:52:27)\n at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)\n at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)\n at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:686:14)\n at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)\n at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)\n at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10\n at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)\n at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:688:12)\n at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:116:18)",
"StackId": "arn:aws:cloudformation:ap-southeast-2:028446965111:stack/companyproductjosh22apsoutheast2A61AF646/5ae288d0-a237-11ed-9f7a-06ed84041138",
"RequestId": "91a5269f-09b3-466f-85e3-84b35afc615d",
"PhysicalResourceId": "40ad19e5-12d3-4330-bae5-56a5587df2dd",
"LogicalResourceId": "ExportsWritereuwest25F52B32F9AB3BFFD"
} |
Thanks @joshbalfour for creating the PR, the team will try to review it when time permits. |
This is a CloudFormation limitation stemming from custom resource provider responses being limited to 4096 bytes - docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html. In the specific use case you've provided you can fix this by shortening the overall stack name by either shortening the stack prefix or by not using nested stacks which is adding to the stack name length. Longer term I'm not sure there is a good alternative here besides maybe introducing a way to control the parameter name length. We can't truncate or provide something like outputPaths since all of the imports are needed in the response back to CloudFormation. This PR adds some documentation explaining this - #30115 |
…ure from response objects being too large (#30115) ### Issue #23958, #25114 ### Reason for this change Using the `crossRegionReference` flag on `StackProps` can produce deployment errors associated with response objects being too large. The root cause of this is a CloudFormation limitation that restricts the total size of a custom resource provider response body to [4096 bytes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html). Using `crossRegionReference` will create a custom resource in both the producing stack and the consuming stack. The custom resource provider in the producing stack will respond back to CloudFormation with a response object that includes all exported parameter names and values. Similarly, the consuming stack will respond back to CloudFormation with a response object that includes all imported parameter names and values. The parameter names are created with the following naming format: `/cdk/exports/${consumingStackName}/${export-name}`. Users need to be careful about stack names and the use of nested stacks to limit the overall length of parameter names which will limit the size of the response body. This PR adds documentation to give more context about this issue and ways to help mitigate it. ### Description of changes Added documentation. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
When using cross-region references between stacks I get this error:
(The following resource(s) failed to update: [ExportsWritereuwest25F52B32F9AB3BFFD]. ): Response object is too long.
This might be because I'm exporting resources from a nested stack so the generated keys are really long.
I'm aware cross-region references are very alpha, and I have a workaround I'm going to try that basically replicates the functionality but does one resource reference at a time, not ideal as it will be much slower.
Expected Behavior
The reference to work as expected.
Current Behavior
The stack fails to deploy.
Reproduction Steps
The resource when synthed looks like this:
Possible Solution
Maybe using
outputPaths
might help, but if the key length is what's causing the issue I can see how this wouldn't necessarily help.Additional Information/Context
No response
CDK CLI Version
2.63.0
Framework Version
No response
Node.js Version
18
OS
alpine
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: