Hands-On: Recreate Security Groups for New VPC
Explore how to recreate security groups within a new custom VPC by specifying the VPC ID and applying tags. Learn to manage multiple security groups with identical names by using unique IDs and adding security rules using AWS CLI, preparing you to migrate WordPress instances securely.
We'll cover the following...
Because security groups are linked to a VPC, we now need to recreate the security groups to migrate our WordPress instance into the new VPC.
We have seen how to create security groups in the fifth chapter. So, the following steps shouldn’t be new us:
- Create an empty security group.
- Add rules to this empty security group.
- Repeat for each security group to be created.
The only difference here from what we did in the fifth chapter is that we need to specify the VPC now because we aren’t using the default VPC anymore. We will also assign the team=wordpress tag to all the resources we create in this lesson.
Create the ssh-access security group
This was the command we used in the fifth chapter:
Now, let’s modify it a bit to specify the vpc-id and add the tags.
Let’s go through the parameters we added:
--vpc-idspecifies the VPC in which the security groups should be created. We can use our$VPC_ID