Mikkel Wied Frederiksen
03/16/2022, 4:16 PMFrank
RDS
construct doesn’t support using an existing cluster.Frank
Frank
Mikkel Wied Frederiksen
03/16/2022, 5:08 PMFrank
Mikkel Wied Frederiksen
03/16/2022, 5:09 PMMikkel Wied Frederiksen
03/16/2022, 5:10 PMFrank
Frank
RDS
construct creating a new cluster, it will would reuse the existing cluster.Mikkel Wied Frederiksen
03/17/2022, 9:53 AMec2.Vpc.fromLookup
with the vpcId
set to the already instanciated vpc.. But since the config for the vpc was removed from my config, cloudformation tried to delete it. but the ec2.Vpc.fromLookup
also wrote the the vpc config to cdk.context.json
which seemed to deny cloudformation from deleting the vpc.. So it took a couple of hours for cloudformation to stabilize. And the old vpc ended up getting deleted anyway.Frank
Mikkel Wied Frederiksen
03/21/2022, 8:48 AMFrank
// previously created VPC
const vpc = new ec2.Vpc(...);
// newly created RDS
new RDS(this, "db", {
rdsServerlessCluster: {
vpc,
},
...
});
Frank
Mikkel Wied Frederiksen
03/22/2022, 8:43 AMFrank
Mikkel Wied Frederiksen
03/23/2022, 8:48 AM