Activity 2: Creating an Ntier Architecture using CF Template contd
- Now lets try to add subnets as shown below
- The manual way of creating subnet is as shown below
- Refer Here for the resource documentation of cloud formation subnet
- Sometimes when we create resources, we might need info about other resources created with in the template. IN this case we need vpc id
- AWS Cloudformation has return values, which can be used by other resources to fetch the information about the created resource.
- To get the vpc id we just need to use the ref function
- Refer Here for the changes done and the create the stack
- The resources created are
- Create a parameter for cidr ranges and to select the indiviudal item used
Fn::selectRefer Here - Refer Here for the changes done
- As of now our template has hard coded AZ values, if we parametrize them the template can be executed in any region
- AWS has some AWS-specific parameter which we can use so that it would be useful Refer Here
- Refer Here for the changes made to the template
- Now try to use the template then update the stack so in properties we would see the following
- Now lets try to create and attach internet gateway to our vpc
- Refer Here for the changes done
- Apply the template to create the stack
