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.
Your JSON is not well-formed.
The line below CustomJSON
has an extra closing bracket that should be removed:
},
There is a typo in profils
that doesn't seem intentional (though probably unrelated to the current error).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With