Cloudformation contd
-
Architecture to be realized
-
Create a vpc
- Manual steps: refer classroom video
- Add subnets to existing vpc
Cloudformation
- Setup Visual studio code
- Create an empty folder called
ntierand open this in visual studio - Ensure the cloudformation extension is installed

- Create an empty folder called
- Refer Here for cloudformation anatomy
- since we need to create vpc

- Refer Here for the template created.
- Now lets deploy the template from AWS Console in Cloudformation service



- Note: By default cloudformation will create all the resources and if any error occurs it doesn’t create anything
- Refer Here for the changes added to create subnets and now update the cloudformation stack

- Reference function in aws cloudformation allows us to dynamically get information from other resources created in template Refer Here
- Refer Here for the usage of reference function
-
Exercise:
- Create a vpc with name tag primary and 6 subnets
- web1:
- az: ap-south-1a
- cidr: 10.10.0.0/24
- web2
- az: ap-south-1b
- cidr: 10.10.1.0/24
- app1
- az: ap-south-1a
- cidr: 10.10.2.0/24
- app2
- az: ap-south-1b
- cidr: 10.10.3.0/24
- db1
- az: ap-south-1a
- cidr: 10.10.4.0/24
- db2
- az: ap-south-1b
- cidr: 10.10.5.0/24
- web1:
- Create a vpc with name tag primary and 6 subnets
