import: support importing resources into nested stacks
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
I would like to be able to import into the nested stack in the following structure:
```
Stack
NestedStack
ResourceToImport
```
### Use Case
I have nested stacks with resources that need to be imported
### Proposed Solution
I am not familiar with all the implementation details of `import` but some options that come to mind are:
- Treat nested stacks like root stacks in that you can select them for import (e.g. `cdk import MyStack/MyNestedStack`)
- When import is run on a root stack, it is recursively ran on all nested stacks under that stack
### Other Information
The implementation of this feature may have some interplay with the implementation of #20917 since both have to do with the selection and processing of stacks for `import`
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.29.1
### Environment details (OS name and version, etc.)
Windows 10 Enterprise Version 10.0.19044
Contributor guide
Research direction
The issue names no files or tests; start by tracing the CDK import entry point and how stacks are selected and processed, then compare the related concerns in #20917. Done means resources can be imported into a nested stack, either by selecting that stack directly or through recursive root-stack processing, with the behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100