title: How to reference the the AWSEBV2LoadBalancer Subnets property?
body: <p>I'm following the AWS guide for deploying an HA Wordpress site to Elastic Beanstalk which includes using the eb-php-wordpress extension. The process requires editing a couple of configuration files with known resource IDs prior to deploying the application.</p>
  
  <p>In particular, the instructions say to edit the efs-create.config file with a VPC ID, and Subnet IDs. The file, among other things, helps set the OptionSettings property of the AWS::ElasticBeanstalk::Environment resource. Thanks to <a href="https://stackoverflow.com/a/55655096/1602022">danimal</a>, I now know how to pull the VpcId into the file using <code>Fn::GetAtt</code>:</p>
  
  <pre><code>option_settings:
    aws:elasticbeanstalk:customoption:
      EFSVolumeName: "EB-EFS-Volume"
      VPCId: { "Fn::GetAtt" : [ "AWSEBSecurityGroup", "VpcId" ] }
    ## Subnet Options
      SubnetA: "subnet-XXXXXXXX"
      SubnetB: "subnet-XXXXXXXX"
      SubnetC: "subnet-XXXXXXXX"
      SubnetD: "subnet-XXXXXXXX"
  </code></pre>
  
  <p>Now my obstacle is getting those subnet IDs added. I tried applying the same, but slightly expanded, concept to the <code>AWSEBV2LoadBalancer</code> resource to pull the Subnets array, but I got an error.</p>
  
  <p>The code:</p>
  
  <pre><code>SubnetA: { "Fn::Select" : [ "0", { "Fn::GetAtt" : [ "AWSEBV2LoadBalancer", "Subnets" ] } ] }
  SubnetB: { "Fn::Select" : [ "1", { "Fn::GetAtt" : [ "AWSEBV2LoadBalancer", "Subnets" ] } ] }
  SubnetC: { "Fn::Select" : [ "2", { "Fn::GetAtt" : [ "AWSEBV2LoadBalancer", "Subnets" ] } ] }
  SubnetD: { "Fn::Select" : [ "3", { "Fn::GetAtt" : [ "AWSEBV2LoadBalancer", "Subnets" ] } ] }
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code> Service:AmazonCloudFormation, Message:Template error: resource AWSEBV2LoadBalancer does not support attribute type Subnets in Fn::GetAtt
  </code></pre>
  
  <p>I found this odd since the generated template shows <code>Subnets</code> under that resouce :</p>
  
  <pre><code>"AWSEBV2LoadBalancer": {
      "Properties": {
          "SecurityGroups": [
              {
                  "Ref": "AWSEBLoadBalancerSecurityGroup"
              }
          ],
          "Subnets": [
              "subnet-0ec0699f08ff45e6e",
              "subnet-0a4fec611d42b062f",
              "subnet-09a4c28b8f330c0c3",
              "subnet-0ea8d69e46ce87afc"
          ]
      },
      "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer"
  },
  </code></pre>
  
  <p>I also tried assigning the array using <code>Subnets: { "Fn::GetAtt" : [ "AWSEBV2LoadBalancer", "Subnets" ]</code> and then using <code>Fn::Select</code> and <code>Ref</code> on that: <code>SubnetA: { "Fn::Select" : [ "0", [ "Ref" : "Subnets" ] ] }</code> but that created its own error:</p>
  
  <pre><code>Service:AmazonCloudFormation, Message:Template format error: Unresolved resource dependencies [Subnets] in the Resources block of the template
  </code></pre>
  
  <p>How do I extract that array and assign each element to a different resource?</p>