title: Template error: instance of Fn::GetAtt references undefined resource
body: <p>I have this cloudformation template :</p>
  
  <pre><code>"InstanceProfileProd": {
    "Type" : "AWS::IAM::InstanceProfile",
    "Properties": {
      "Path": "/",
      "Roles" : [ { "Ref" : "InstanceRole"} ]
    }
  },
  
  "CompLayer": {
    "Type": "AWS::OpsWorks::Layer",
    "DependsOn" : "OpsWorksServiceRole",
    "Properties": {
      "AutoAssignElasticIps" : false,
      "AutoAssignPublicIps" : true,
      "CustomJson" : {
        },
        "awscli" : {
          "profils" : {
            "default" : {
              "role_arn": { "Fn::GetAtt": [ "InstanceProfileProd","Arn" ] }
            }
          }
        },
      },
      "CustomSecurityGroupIds" : { "Ref" : "SecurityGroupIds" },
      "EnableAutoHealing" : true,
      "InstallUpdatesOnBoot": false,
      "LifecycleEventConfiguration": {
        "ShutdownEventConfiguration": {
          "DelayUntilElbConnectionsDrained": false,
          "ExecutionTimeout": 120 }
        },
        "Name": "Layer",
        "Shortname" : "layer1",
        "StackId": { "Ref": "CompStack" },
    }
  },
  </code></pre>
  
  <p>When I validate the template I get this error : </p>
  
  <pre><code>An error occurred (ValidationError) when calling the ValidateTemplate operation: Template error: instance of Fn::GetAtt references undefined resource InstanceProfileProd
  </code></pre>
  
  <p>The resources are all properly defined and well writen; I don't understand why I am getting this error.
  The instance profile is referenced in all the layers of my opsworks stack.</p>