Skip to content

Commit ef5edf5

Browse files
authored
chore(ec2): update vpc README with vpc lookup method (#34544)
### Issue # (if applicable) ### Reason for this change We recommend to use cross stack reference but does not provide workaround when fail due to cross stack reference issue. ### Description of changes Adding a readme to explain ### Describe any new or updated permissions being added ### Description of how you validated changes ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7fa3bbd commit ef5edf5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/aws-cdk-lib/aws-ec2/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,14 @@ instance around:
608608

609609
[sharing VPCs between stacks](test/integ.share-vpcs.lit.ts)
610610

611+
> Note: If you encounter an error like "Delete canceled. Cannot delete export ..."
612+
> when using a cross-stack reference to a VPC, it's likely due to CloudFormation
613+
> export/import constraints. In such cases, it's safer to use Vpc.fromLookup()
614+
> in the consuming stack instead of directly referencing the VPC object, more details
615+
> is provided in [Importing an existing VPC](#importing-an-existing-vpc). This
616+
> avoids creating CloudFormation exports and gives more flexibility, especially
617+
> when stacks need to be deleted or updated independently.
618+
611619
### Importing an existing VPC
612620

613621
If your VPC is created outside your CDK app, you can use `Vpc.fromLookup()`.

0 commit comments

Comments
 (0)