You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): logicalId is consumed prior to being overridden (#20560)
When using `Stack.exportValue` to manually create a CloudFormation
export, the logicalId of the referenced resource is used to generate the
logicalId of the `CfnExport`. Because `exportValue` creates a
`CfnExport` _and_ returns an `importValue` it needs to _resolve_ the
logicalId at call time. If the user later overrides the logicalId of the
referenced resource, that override is reflected in the export/import
that was created earlier.
There doesn't seem to be a way to solve this without incurring a
breaking change so this PR attempts to smooth a rough edge by "locking"
the `logicalId` when `exportValue` is called. If the user attempts to
override the id _after_ that point, an error message will be thrown
closes#14335
----
### All Submissions:
* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)
### Adding new Unconventional Dependencies:
* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)
### New Features
* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
0 commit comments