title: AWS Cloudformation : Fn::Join within a Fn::FindInMap statement?
body: <p>Trying to use Fn::Join within Fn::FindInMap, as below:</p>
  
  <pre><code>"SubnetId": {
      "Fn::FindInMap": [
          {
              "Ref": "OrganizationName"
          },
          "AZ",
          {
              "Fn::Join": [
                  "",
                  [
                      {
                          "Ref": "Environment"
                      },
                      {
                          "Ref": "Member1AZ"
                      }
                  ]
              ]
          }
      ]
  }
  </code></pre>
  
  <p>The OrganizationName, Environment and Member1AZ are all parameters. Essentially it should hook up to my mappings and produce, for example :</p>
  
  <pre><code>"SubnetId" : { "Fn::FindInMap" : [ "Organization2", "AZ", "prod1c" ]}
  </code></pre>
  
  <p>However, it does not seem to be taking the output from the Fn::Join as a single entity on the Fn::FindInMap, it validates correctly if I hardcode that section of the template.</p>
  
  <pre><code>A client error (ValidationError) occurred when calling the ValidateTemplate operation: Template error: every Fn::FindInMap object requires three parameters, the map name, map key and the attribute for return value
  </code></pre>
  
  <p>My Mappings are as follows:</p>
  
  <pre><code>Mappings" : {
        "OrganizationDefaults" : {
              "AZ" : {
                  "prod1a" : "subnet-foobar1",
                  "qa1a" : "subnet-foobar2",
                  "prod1c" : "subnet-foobar3",
                  "qa1c" : "subnet-foobar4"
              }
        },
        "OrganizationTwo" : {
              "AZ" : {
                  "prod1a" : "subnet-foobar5",
                  "qa1a" : "subnet-foobar6",
                  "prod1c" : "subnet-foobar7",
                  "qa1c" : "subnet-foobar8"
              }
        },
  },
  </code></pre>
  
  <p>Can anyone help on this, or had to do something similar before? I need to use the same template for any organizations listed, so Mappings should solve this for me, if I can get it right.</p>