I have implemented a basic combination of an AWS Eventbridge rule and a Lambda function as its target. The rule is suppose to create an event based on all AWS AutoScaling events and invoke the Lambda. This works well when triggering a scaling action for an existing ASG, but when creating a new ASG with the same prefix the rule is not reacting. Old ASG name: test-asg-lc-123 New ASG name: test-asg-lc-124
Is it even possible to use a wildcard?
"detail": {
"AutoScalingGroupName": [
"test-asg-lc-*"
]
},
"detail-type": [
"EC2 Instance Launch Successful",
"EC2 Instance Terminate Successful",
"EC2 Instance Launch Unsuccessful",
"EC2 Instance Terminate Unsuccessful",
"EC2 Instance-launch Lifecycle Action",
"EC2 Instance-terminate Lifecycle Action",
"EC2 Auto Scaling Instance Refresh Checkpoint Reached"
],
"source": [
"aws.autoscaling"
]
}
It looks like wildcard is not supported in this case. AWS documentation mentions The matching is exact (character-by-character), without case-folding or any other string normalization.
and no * or wildcard is mentioned in the documentation.
Reference: https://docs.aws.amazon.com/eventbridge/latest/userguide/filtering-examples-structure.html
You can follow Prefix Matching mentioned in this documentation https://docs.aws.amazon.com/eventbridge/latest/userguide/content-filtering-with-event-patterns.html#filtering-prefix-matching