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: pluggable/cross-region NestedStack #26814

Open
2 tasks
rv2673 opened this issue Aug 18, 2023 · 2 comments
Open
2 tasks

core: pluggable/cross-region NestedStack #26814

rv2673 opened this issue Aug 18, 2023 · 2 comments
Labels
@aws-cdk/core Related to core CDK functionality effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2

Comments

@rv2673
Copy link
Contributor

rv2673 commented Aug 18, 2023

Describe the feature

Extend NestedStack functionality to allow changing the resulting implementation(CfnStack) with other (custom)resource/construct to allow different implementation without having to workaround the token resolving mechanism that is done on stack level.

It would allow for a custom resource to be used, that deploys the stack cross region and exposing the stack outputs as outputs of custom resource without having to workaround or add additional writers/readers to pass value cross-region.

That functionality might be built into cdk or user can implement this functionality for their use case and hook into cdk through NestedStack hook.

Use Case

It is frustrating to work with cdk in cross-region scenarios and the currently builtin solutions are mostly experimental or finicky to use.

In cloudformation/cdk we can easily add nested stacks with the NestedStack construct. cdk handles the inputs and outputs, generating template, publishing it etc all transparently. In case of rollback the nested stack is also attempted to be rolled back.

For certain resources like Cloudfront certain referenced resources like lambda@edge, Waf, certificates all must be deployed in us-east-1. Cdk contains a lot of custom resources and workarounds to make certain constructs easier to use in a cross-region manner.

Most of them are not easily extendable or are finicky to use, mainly because the reference resolving and linking is all on stack level and the resource need to create in mechanism to detect and workaround this resolving.

It would also open the cross-region functionality more easily for more resources than having such functionality having to be built in into every resource type.

Proposed Solution

Extend NestedStack so that a different resource than CfnStack like a custom resource that deploy stack in different region.

That custom resource might even be provider through cdk itself and be used if NestedStack is provided different env than the containing stack.

Other Information

No response

Acknowledgements

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

CDK version used

2.92.0

Environment details (OS name and version, etc.)

Ubuntu 22.04

@rv2673 rv2673 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 18, 2023
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Aug 18, 2023
@peterwoodworth
Copy link
Contributor

peterwoodworth commented Aug 18, 2023

So basically, a custom resource provider that can handle deploying stacks of any arbitrary use cases cross-region/environment?

@peterwoodworth peterwoodworth added p2 effort/large Large work item – several weeks of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 18, 2023
@rv2673
Copy link
Contributor Author

rv2673 commented Aug 19, 2023

So basically, a custom resource provider that can handle deploying stacks of any arbitrary use cases cross-region/environment?

Yes that would be basically be the idea. Not sure if we would want to support all arbitrary usecases from standard aws-cdk-lib.

But if endusers could override use of CfnStack in NestedStack with custom resource(with specific interface) they could implement resource supporting their usecase themselves if it is not supported by default.

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/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants