You use TargetGroupArn in a CF template for ECS services. I have a situation where the target group has already been created and I want to make this a param for the template
But those arn's are awful:
arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup/mytarget/4ed48ba353064a79
That unique number at the end makes this almost impossible. Can I reference the target by name instead of full arn in the template?
Maybe i can use Fn::GetAtt here but not sure what that looks like
This doesn't work:
I get error: An error occurred (ValidationError) when calling the CreateChangeSet operation: Template error: instance of Fn::GetAtt references undefined resource mytarget
{ "Parameters": { "VPC": { ... "TargetGroup": { "Description": "TargetGroup name for ListenerRule", "Type": "String", "Default": "my-target" } }, "Resources": { "Service": { "TaskDefinition": { .... "ListenerRule": { .... "Actions": [ { "TargetGroupArn": { "Ref": "TargetGroup" }, "Type": "forward" } ] } }, "ServiceRole": { } }