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

core: Nested Stack templates cannot be suppressed natively by the CDK #32798

Open
1 of 2 tasks
Rizxcviii opened this issue Jan 8, 2025 · 1 comment
Open
1 of 2 tasks
Labels
@aws-cdk/core Related to core CDK functionality effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@Rizxcviii
Copy link
Contributor

Describe the feature

Allow nested stack templates to be suppressed by removing indentation.

Use Case

When a nested stack gets too large in size, we reach an error similar to the follow

ExampleStack failed: Error: The stack named ExampleStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Template may not exceed 1000000 bytes in size.

Proposed Solution

Add the same functionality found within a Stack construct onto a NestedStack construct.

Other Information

This already exists, and it would trying to replicate the suppressTemplateIndentation onto NestedStacks.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.174.0

Environment details (OS name and version, etc.)

Windows 11

@Rizxcviii Rizxcviii added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2025
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Jan 8, 2025
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2025
@khushail khushail self-assigned this Jan 8, 2025
@khushail
Copy link
Contributor

khushail commented Jan 8, 2025

@Rizxcviii , thanks for reaching out. I see that suppressTemplateIndentation is provided in StackProps as illustrtated in here -https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.StackProps.html#suppresstemplateindentation but in NestedStackProps, this is currently not supported- https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.NestedStackProps.html.

As suppressTemplateIndentation leads to reduction in size of the template -

const SUPPRESS_TEMPLATE_INDENTATION_CONTEXT = '@aws-cdk/core:suppressTemplateIndentation';

To do this for all templates, set the context key `@aws-cdk/core:suppressTemplateIndentation` to `true`.

suppressTemplateIndentation?

Type: boolean (optional, default: the value of @aws-cdk/core:suppressTemplateIndentation, or false if that is not set.)

Enable this flag to suppress indentation in generated CloudFormation templates.

If not specified, the value of the @aws-cdk/core:suppressTemplateIndentation context key will be used. If that is not specified, then the default value false will be used.

It would be good to have this property for NestedStack.
Marking this feature as P2 as it won't be immediately addressed by the team but would be on their radar. Contributions are also welcome.

@khushail khushail added effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jan 8, 2025
@khushail khushail removed their assignment Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants