(upbeat music)
- Hi, I'm Suvendu a cloud support engineer
from the AWS office in Bangalore.
Sometimes I speak to customers who want
to change the VPC that contains
their Amazon RDS DB instance.
I tell them changing the VPC for a DB instance
, requires a reboot of the instance,
because the DB instance moves from one network to another.
So the appropriate network configurations
such as security group inbound rules, subnet group,
and route tables should be done on the new VPC
before the RDS DB instance is moved to the new VPC.
Let me walk you through the process.
First, let me highlight some restrictions.
You cannot changed the VPC for a DB instance,
if the DB instance is in multiple Availability Zones.
In that case, first we need to convert the DB instance
to a single Availability Zone, and then convert it back
to a Multi-AZ DB instance after moving to the new VPC.
Changing the RDS instance VPC is also restricted
for DB instance which is a read replica
or has read replicas.
We need to first remove the read replicas
and then add read replicas after the DB instance is moved
to the new VPC.
Please note ,the steps so in this video
are not applicable for Amazon RDS Aurora Clusters.
For an Amazon Aurora cluster,
first we need to take a cluster snapshot
and then create a new subnet group
using the new VPC subnets.
Then restore the snapshot in the new VPC subnet group.
You can find more details here.
For this demo, I already created an Amazon RDS instance,
and a secondary VPC
where our existing Amazon RDS instance will be migrated.
Now let's start.
As you can see, I've already logged
into my AWS Management Console.
Let's go to the RDS console.
Now, go to instances choose your Amazon RDS instance
to find the instance details.
In this case, it is RDS 01, to find more details,
I'll click on the instance name.
On the details page, under the security and network section,
you can also see the current VPC details.
At the first, step we will create a new subnet group.
During the creation of the subnet group
we will have the option
to choose which VPC the subnet group will belong to.
Then, add the required subnets.
In this demo, I'm going to use a secondary VPC
and its subnets to create a new subnet group.
To create a new subnet group,
on the left panel of the RDS console choose subnet groups.
Choose Create DB subnet group,
give an appropriate name and description
to the new subnet group.
Now choose the new VPC where you want
to migrate your RDS instance.
In this case for me, this is the new VPC.
When the VPC is selected,
you can select Specific Availability Zones subnets
or you can add all the subnets related to the new VPC.
In this demo, I'm adding all the subnets associated
with the current VPC.
Now choose create,
now you can see our new DB subnet group is created.
After the subnet group is created,
we'll modify the instance VPC
by specifying the new DB subnet group.
To make this change, on the left panel of the RDS console,
choose instances.
Select the DB instance for which you want to change the VPC,
and in our case it is RDS 01.
Choose Instance Actions and choose modify.
On the modified DB instance page, under the network
and security section, select the new subnet group
from the drop down list which is associated
with the new VPC.
Also, select the appropriate security groups
associated with that VPC.
In this case, I'll go with the default security group.
Choose continue.
You can review the summary of modification,
So in this case, you can see we have a new DB subnet group
and a new security group.
You can make these changes during your schedule window,
or you can choose to make the changes immediately.
But please note, this change is going
to call the downtime for the instance
and during this modification,
the DB instance is not accessible to the users.
So this activities should be scheduled during
a maintenance window.
For this demo, I'm selecting apply immediately.
Now choose modify DB instance.
Now, you will see moving to VPC in the Status column
on the RDS task board.
This status will remain for a few minutes.
When the modification is complete,
the Status column changes to available
and we can quickly validate the new VPC
from the console under the VPC tab.
You can now start working with your Amazon RDS instance,
which is now running under the new VPC.
Thanks for watching and happy cloud computing
from all of us here at AWS.
(upbeat music)