https://serverless-stack.com/ logo
#help
Title
# help
m

Mikkel Wied Frederiksen

03/16/2022, 4:16 PM
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

Frank

03/16/2022, 5:05 PM
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

Mikkel Wied Frederiksen

03/16/2022, 5:08 PM
thanks.. 🙂 looking forward to it.. 😄
f

Frank

03/16/2022, 5:09 PM
Hit me up here if we haven’t gotten to it by early April 😁
m

Mikkel Wied Frederiksen

03/16/2022, 5:09 PM
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

Frank

03/17/2022, 1:58 AM
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

Mikkel Wied Frederiksen

03/17/2022, 9:53 AM
@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

Frank

03/18/2022, 10:13 AM
Oh.. was the previous instantiated VPC created manually in AWS console or within the SST app?
m

Mikkel Wied Frederiksen

03/21/2022, 8:48 AM
@Frank it was create with SST…
f

Frank

03/22/2022, 5:11 AM
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

Mikkel Wied Frederiksen

03/22/2022, 8:43 AM
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

Frank

03/23/2022, 5:04 AM
Gotcha. Will keep you posted
m

Mikkel Wied Frederiksen

03/23/2022, 8:48 AM
thanks.. 😄
6 Views