CloudWatch Alarm creation fails with colon in alarm name
warningconfigurationUpdated Aug 21, 2024(via Exa)
Technologies:
How to detect:
Creating a CloudWatch alarm with a colon `:` character in the alarm name fails with AttributeError. The _resource_arn() function in localstack/utils/aws/arns.py incorrectly treats any name containing ':' as an ARN, causing alarm_arn extraction to return None. Affects LocalStack versions prior to 3.7 (fixed after Sep 5, 2024).
Recommended action:
Upgrade to LocalStack latest image (version 3.7+) where the fix is available. As a workaround in older versions, avoid using colons in CloudWatch alarm names. The fix changed ARN detection from checking for ':' presence to checking for 'arn:' prefix in the _resource_arn() function.