-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Describe the bug
i have created a network stack with 3 subnets: one public, one private with egress, and one isolated.
in a separate database stack i'm creating a database cluster (Aurora Serverless V2 Postgres) and initially used the public subnet by setting vpcSubnets: { subnetType: SubnetType.PUBLIC }
.
Now I would like to move the database to the isolated subnet by setting vpcSubnets: { subnetType: SubnetType.PRIVATE_ISOLATED }
, however this results in an error: ExportsOutputRefnetworkstackvpcingressSubnet3SubnetCD2EA007C4DD55EA cannot be deleted as it is in use by database-stack.
I have tried doing a deployment that adds the new isolated subnets without removing the public ones, and that succeeded. But when I try to remove the public subnets I face the same error.
Expected Behavior
the cdk should be able to reassign the subnets without errors
Current Behavior
deployment fails with an error: ExportsOutputRefnetworkstackvpcingressSubnet3SubnetCD2EA007C4DD55EA cannot be deleted as it is in use by database-stack.
Reproduction Steps
create a vpc with public and isolated subnets.
create a database cluster in a vpc with vpcSubnets: { subnetType: SubnetType.PUBLIC }
.
then deploy again with vpcSubnets: { subnetType: SubnetType.PRIVATE_ISOLATED }
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.85.0
Framework Version
No response
Node.js Version
18.15.0
OS
macOS
Language
Typescript
Language Version
TypeScript (5.1.3)
Other information
No response