Reputation: 538
I am having difficulty passing Load Balancer info when creating alarm in CloudFormation.
RequestCountHigh:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmDescription: Scale up
MetricName: RequestCount
Namespace: AWS/ApplicationELB
Statistic: Average
Period: 300
EvaluationPeriods: 1
Threshold: 2
AlarmActions: [!Ref ScaleUpPolicy]
Dimensions:
- Name: LoadBalancer
Value: !Ref WebAppALB
ComparisonOperator: GreaterThanThreshold
It is passing Load Balancer information in format: arn:aws:elasticloadbalancing:us-west-2:932921245520:loadbalancer/app/Appro-WebAp-1MH0X13S89TO8/b2f9795447cbxxxx
Instead of in format app/Appro-WebAp-1MH0X13S89TO8/b2f9795447cbxxxx
This causes Alarm to be in INSUFFICIENT state. Please advice.
Upvotes: 1
Views: 849
Reputation: 43651
Assuming your WebAppALB
is a AWS::ElasticLoadBalancingV2::LoadBalancer
, !Ref WebAppALB
returns the ARN of the load balancer.
You probably need !GetAtt WebAppALB.LoadBalancerFullName
instead. Please check the documentation on return values of AWS::ElasticLoadBalancingV2::LoadBalancer
.
Upvotes: 3