Hi.. I’m updating a SST setup from 0.53 to 0.68 (w...
# help
m
Hi.. I’m updating a SST setup from 0.53 to 0.68 (working great so far). I want to utilize the new RDS console, so i’m trying to rewrite my stack to use the new RDS construct. I’m using postgres with aurora serverless. It’s really not hard to move my stack to the new RDS, but i cannot figure out how to keep the old RDS/VPC from being deleted. Is this intentional (and should I therefore do a manual migration of my data from the old db to the new) or did I miss some trick to make the transition. 🤔
f
Hey @Mikkel Wied Frederiksen, currently the
RDS
construct doesn’t support using an existing cluster.
It’s something we are planning to support. Mostly likely by the end of the month,
m
thanks.. 🙂 looking forward to it.. 😄
f
Hit me up here if we haven’t gotten to it by early April 😁
m
I will..
I’m just testing out the https://docs.serverless-stack.com/constructs/RDS#import-an-existing-vpc on our staging env and aws is not happy about it.. Started the test before i wrote my question here.. I hoped it would solve the issue..
f
oh what’s wrong? Importing an existing VPC is an eazy part, as in you can create a new RDS cluster inside an existing VPC.
What we plan to support is importing an existing RDS cluster. So instead of the
RDS
construct creating a new cluster, it will would reuse the existing cluster.
m
@Frank I deleted the old configuration and put everything into the new RDS, and i used the
ec2.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.
f
Oh.. was the previous instantiated VPC created manually in AWS console or within the SST app?
m
@Frank it was create with SST…
f
Ahh I see. It’s not very useful to say this now, if you run into a similar situation again, you can keep the previously created VPC (not remove the VPC construct in ur SST app). U can pass that into a new RDS construct. ie.
Copy code
// previously created VPC
const vpc = new ec2.Vpc(...);

// newly created RDS
new RDS(this, "db", {
  rdsServerlessCluster: {
    vpc,
  },
  ...
});
Anyhow, did u get a chance to try out the new RDS construct?
m
yeah I figured I could something like your code example afterwards.. 🙂 I tried the new construct, and its working great, but i reverted back to the old, waiting for the option to keep the existing RDS..
f
Gotcha. Will keep you posted
m
thanks.. 😄