I am having a lambda function that trigger a Jenkins job. I want to invoke this lambda when a new ssm parameter is added. I have added the below Custom event pattern in the cloud-watch event pattern.
{
"source": [
"aws.ssm"
],
"detail-type": [
"Parameter Store Change",
"Parameter Store Policy Action"
],
"detail": {
"name": [
"/dev/*"
],
"operation": [
"Create",
"Update",
"Delete",
"LabelParameterVersion"
]
}
}
This means, the lambda need to trigger if i create a ssm parameter start with "/dev/anystring" But the lambda is not triggering if i provide wild card. Any suggestion on this.?
CloudWatch Events provides a default event bus that exists in every AWS account. All AWS events are routed via the default bus. You can also choose to publish your custom events to the default bus. EventBridge introduces custom event buses you can use exclusively for your own workloads.
An event pattern is one of the key concepts used in many advanced real-time analytics approaches, particularly CEP systems. It captures relationships between events in the real world.
In this case you want to use the prefix comparison operator to filter based on values in the detail.name
field.
{
"source": [
"aws.ssm"
],
"detail-type": [
"Parameter Store Change",
"Parameter Store Policy Action"
],
"detail": {
"name": [ { "prefix": "/dev/" } ],
"operation": [
"Create",
"Update",
"Delete",
"LabelParameterVersion"
]
}
}
For more details, see Reducing custom code by using advanced rules in Amazon EventBridge, especially example 2. All ATMs in New York City in the section Filtering events in a custom application.
I am contributing this on behalf of my employer, Amazon. My contribution is licensed under the MIT license. See here for a more detailed explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With