title: Cloudformation in create stack error: "ELB cannot be attached to multiple subnets in the same AZ"
body: <p>I trying to build infrastracture with Cloudformation json template. When I added two Subnets and SubnetRouteTableAssociation in both availability zones that i need. But creating process failing to create Loadbalancers with error:</p>
  
  <blockquote>
    <p>CREATE_FAILED AWS::ElasticLoadBalancing::LoadBalancer Rest ELB cannot
    be attached to multiple subnets in the same AZ.</p>
  </blockquote>
  
  <p>Here is the Parameters of AZs:</p>
  
  <pre><code>"AZs" : {
              "Description" : "The list of AvailabilityZones.",
              "Type" : "CommaDelimitedList",
              "Default" : "us-east-1a,us-east-1c"
          }
  </code></pre>
  
  <p>Here is Resources of  Subnets, SubnetRouteTableAssociation in both availability zones and ElasticLoadBalancing of Rest:</p>
  
  <pre><code>"PublicSubnet1a" : {
        "Type" : "AWS::EC2::Subnet",
        "Properties" : {
          "VpcId" : { "Ref" : "VPC" },
          "CidrBlock" : "10.0.0.0/24",
          "AvailabilityZone": {
            "Fn::Select": ["1", { "Ref": "AZs" }]
          },
          "Tags" : [
            {"Key": "Name", "Value": {"Fn::Join": ["", ["Offering-", {"Ref": "Env"}, {"Ref": "EnvNum"}, "-VPC"]]}},
            {"Key" : "Network", "Value" : "Public" }
          ]
        }
      },
       "PublicSubnet1c" : {
        "Type": "AWS::EC2::Subnet",
        "Properties": {
          "VpcId": { "Ref" : "VPC" },
          "CidrBlock": "10.0.1.0/24",
          "AvailabilityZone": {
            "Fn::Select": ["1", { "Ref": "AZs" }]
          },
          "Tags" : [
            {"Key": "Name", "Value": {"Fn::Join": ["", ["Offering-", {"Ref": "Env"}, {"Ref": "EnvNum"}, "-VPC"]]}},
            {"Key" : "Network", "Value" : "Public" }
          ]
        }
      },
  "PublicSubnet1aRouteTableAssociation" : {
        "Type" : "AWS::EC2::SubnetRouteTableAssociation",
        "Properties" : {
          "SubnetId" : { "Ref" : "PublicSubnet1a" },
          "RouteTableId" : { "Ref" : "PublicRouteTable" }
        }
      },
      "PublicSubnet1cRouteTableAssociation" : {
        "Type" : "AWS::EC2::SubnetRouteTableAssociation",
        "Properties" : {
          "SubnetId" : { "Ref" : "PublicSubnet1c" },
          "RouteTableId" : { "Ref" : "PublicRouteTable" }
        }
      },
  "RestELB" : {
          "Type" : "AWS::ElasticLoadBalancing::LoadBalancer",
          "DependsOn": "AttachGateway",
          "Properties": {
              "LoadBalancerName": {"Fn::Join": ["",["Rest-ELB-", {"Ref": "VPC"}]]},
              "CrossZone" : "true",
              "Subnets": [{ "Ref": "PublicSubnet1a" },{ "Ref": "PublicSubnet1c" }],
              "Listeners" : [
                  {"LoadBalancerPort" : "80", "InstancePort" : "80","Protocol" : "HTTP"},
                  {"LoadBalancerPort" : "6060", "InstancePort" : "6060","Protocol" : "HTTP"}
              ],
              "HealthCheck" : {
                "Target" : "HTTP:80/",
                "HealthyThreshold" : "3",
                "UnhealthyThreshold" : "5",
                "Interval" : "90",
                "Timeout" : "60"
              }
          }
      }
  </code></pre>
  
  <p>What I'm doing wrong?</p>
  
  <p>Thanks!</p>