May 2019
Intermediate to advanced
308 pages
8h 5m
English
Next, we need to create two public subnets. For each, we will specify their dependency on the VPC since they cannot be created before the VPC is created with "DependsOn" : "simpleVPC". We need to define which VP to create the subnet in, but since we don't have the VPC ID, we will need to pull this ID with the reference subroutine using the VPC resource name: "VpcId" : { "Ref" : "simpleVPC" }. We will also need to define two subnets, that is, 10.0.0.0/24 for the first subnet, and 10.0.1.0/24 for the second subnet, and, of course, tag the subnets appropriately.
For the first subnet, we will use the following script with a resource name of PublicSubnetOne:
"PublicSubnetOne" : { "Type" : "AWS::EC2::Subnet", "DependsOn" : "simpleVPC", ...Read now
Unlock full access