I\'m trying to create an Elastic Container Service (ECS) setup from Cloud Formation.
However I don\'t want the ECS repository to have the ugly autogenerated URI:
HostName: !Join [ ".", [ !Ref "AWS::AccountId", "dkr.ecr", !Ref "AWS::Region", !Join [ "/", [ "amazonaws.com", !Ref "dockerrepocompanycom" ] ] ] ]
A more concise way is as follows:
HostName: !Sub "${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${dockerrepocompanycom}"
(adding as separate answer because I lack reputation points to comment on previous answer)