在 aws eventbridge 中为多个事件详细类型创建通用/动态事件规则

问题描述 投票:0回答:1

我们有很多活动

detail-type
。我们需要一个
event rule
来触发
"notify"
事件详细信息类型。以下是所有可能的事件详细信息类型的列表:

com.experian.dcm.input-portfolio-created:v1
com.experian.dcm.published-portfolio-created:v1
com.experian.dcm.published-portfolio:v1
com.experian.dcm.portfolio-preparation.tolerance-check.notify.failure:v1 
com.experian.dcm.portfolio-preparation.tolerance-check.notify.success:v1
com.experian.dcm.portfolio-preparation.apply-threshold.notify.success:v1
com.experian.dcm.portfolio-preparation.apply-threshold.notify.failure:v1
com.experian.dcm.published-portfolio.mi-report.notify.success:v1
com.experian.dcm.published-portfolio.mi-report.notify.failure:v1

我们需要一个足够通用的

custom event rule
来触发以下事件
detail-type
(具有
"notify"
)并阻止所有其他事件
detail-type

com.experian.dcm.portfolio-preparation.tolerance-check.notify.failure:v1 
com.experian.dcm.portfolio-preparation.tolerance-check.notify.success:v1
com.experian.dcm.portfolio-preparation.apply-threshold.notify.success:v1
com.experian.dcm.portfolio-preparation.apply-threshold.notify.failure:v1
com.experian.dcm.published-portfolio.mi-report.notify.success:v1
com.experian.dcm.published-portfolio.mi-report.notify.failure:v1
amazon-web-services events aws-event-bridge
1个回答
0
投票

我使用

wildcard
选项来解决这个问题。
event rule
如下:

{
"detail": {
"id": [{
"exists": true
}],
"source": [{
"exists": true
}],
"specversion": [{
"exists": true
}],
"type": [{
"exists": true
}]
},
"detail-type": [{
"wildcard": "com.expert.efg.*.notify.*"
}],
"source": [
"source"
]
}

© www.soinside.com 2019 - 2024. All rights reserved.