Dear Readers,
In this article, we will see the following How to Create VPC Using Cloud Formation.
Steps to Follow :
- Logging to AWS Account
- Create Stack for creating VPC
- Very VPC Graphically
1. Logging to AWS Account
First, we need to AWS Console page by using below link.
https://aws.amazon.com/console/
Click on sign in to Console button. Logging to aws account
Login using username & password and click on sign in. Enter to AWS Management Console
We can see the AWS Management Console Dashboard. Go to Services, under the compute module click EC2 service to open.
Go to Services, under the Management & Governance module click Cloud Formation service to open.
2. Create Stack for creating VPC
Click on Create stack.
Upload template file
Select Template is ready and click on Upload a template file.
select file “vpc.yml” and click on open.
the file has uploaded and click on Next.
Specify stack stack name “ktexperts-vpc” and click on Next.
click on Next.
Click on Create stack.
we can see the vpc creating is being in progress, It will take time to create.
We can see the vpc “ktexperts-vpc” has created successfully.
3. Verify VPC in Graphically
Go to Services, under the Networking & Content Delivery module click VPC service to open.
Verify VPC “ktexpertsvpc”
Go to Your VPCs,we can the vpc “ktexperts-vpc” has created successfully.
Verify Subnet “ktexpertssubnet”
Go to Subnets,we can the subnet “ktexpertssubnet” has created successfully.
Verify Route Table
Go to Route Tables,we can the RouteTable “ktexpertsRT” has created successfully.
Verify IGW
Go to Internet Gateways, we can the Internet Gateways”ktexpertsigw” has created successfully.
Verify Subnet Association
Go to Route Tables, we can see the subnet association has added successfully.
Verify Route
Go to Route Tables, we can see the Route has added successfully.
Script for creating VPC:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
Resources: createvpc: Type: AWS::EC2::VPC Properties: CidrBlock: 192.168.0.0/16 Tags: - Key: Name Value: Ktexpertsvpc createsubnet: Type: AWS::EC2::Subnet Properties: VpcId: Ref: createvpc AvailabilityZone: ap-south-1a CidrBlock: 192.168.1.0/24 Tags: - Key: Name Value: ktexpertssubnet createroutetable: Type: AWS::EC2::RouteTable Properties: VpcId: Ref: createvpc Tags: - Key: Name Value: ktexpertsRT createigw: Type: AWS::EC2::InternetGateway Properties: Tags: - Key: Name Value: ktexpertsigw createsubnetassociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: Ref: createroutetable SubnetId: Ref: createsubnet createigwattachment: Type: AWS::EC2::VPCGatewayAttachment Properties: InternetGatewayId: Ref: createigw VpcId: Ref: createvpc createroute: Type: AWS::EC2::Route Properties: DestinationCidrBlock: 0.0.0.0/0 GatewayId: Ref: createigw RouteTableId: Ref: createroutetable |
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts