core: Return concrete values for physical names and ARNs if explicitly stated
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
Re-opening this issue: https://github.com/aws/aws-cdk/issues/4093
> ❗️There is a problem: CloudFormation references implicitly indicate that there is a dependency between the consuming resource and the referenced resource. If we return a concrete name (string), this dependency will now be lost forever. Is there anything we can do about it? (@rix0rrr?)
A solution to this could be to return physical names only if embedded in a cross-environment stack. Otherwise return the token.
### Use Case
Trying to reference resources across environments. This *should* be possible if I name the resources at compile-time. However cdk always `tokenizes` it regardless of if a static name is provided or not.
### Proposed Solution
_No response_
### Other Information
_No response_
### Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
latest
### Environment details (OS name and version, etc.)
mac
Contributor guide
Research direction
Start by reviewing the linked issue 4093 and the CDK core behavior for tokenized physical names and ARNs. Trace how explicitly supplied names become CloudFormation references, then determine how cross-environment references and resource dependencies should be preserved. Done means the behavior and dependency semantics are specified clearly enough to implement and test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100