I have this cloudformation template :
"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" },
}
},
When I validate the template I get this error :
An error occurred (ValidationError) when calling the ValidateTemplate operation: Template error: instance of Fn::GetAtt references undefined resource InstanceProfileProd
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.