I'm trying to create an alarm in AWS CloudWatch. There are two CloudFormation templates: one for creating the architecture (for which I have no access) and one for alarms. I want to match ServiceName which prefix is known to me but it has some random suffix. Both ServiceName and ClusterName are related to AWS ECS. Here is code snippet:
SomeAlarm:
Type: 'AWS::CloudWatch::Alarm'
Properties:
...
Dimensions:
- Name: ClusterName
Value: <known cluster name>
- Name: ServiceName
Value: <known prefix><random suffix>
As I understand, I cannot use wildcard or regex in this case, or I don't know any way for achieving it. Also, I'm not able to change first template to export values and import them in second template.
What syntax can I use to match ServiceName? Any thoughts?