Adding private subnets

Now we need to add two private subnets under this VPC:

"PrivateSubnet1": { 
  "Type": "AWS::EC2::Subnet", 
    "Properties": { 
    "VpcId": { 
      "Ref": "VPC" 
    }, 
    "CidrBlock": "10.0.1.0/24", 
    "AvailabilityZone": { 
      "Fn::Select": [ "0", 
        { 
          "Fn::GetAZs": { 
            "Ref": "AWS::Region" 
          } 
        } 
      ] 
    }, 
    "Tags": [ 
      { 
        "Key": "Name", 
        "Value": { 
          "Fn::Sub": "${AWS::StackName}: Private Subnet 1" 
         } 
      } 
    ] 
  } 
}, 
"PrivateSubnet2": { 
  "Type": "AWS::EC2::Subnet", 
  "Properties": { 
    "VpcId": { 
      "Ref": "VPC" 
    }, 
    "CidrBlock": "10.0.3.0/24", 
    "AvailabilityZone": { 
      "Fn::Select": [ 
        "1", 
        { 
          "Fn::GetAZs": { 
            "Ref": "AWS::Region" 
          } 
        } 
      ] 
    }, 
    "Tags": [ 
      { 
        "Key": "Name", 
        "Value": { 
          "Fn::Sub": "${AWS::StackName}: Private Subnet 2" 
        } 
      } 
    ] 
  } 
} 

Here we tell the VPC to create subnets. For the first ...

Get Building Serverless Architectures now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.