最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Why can't I combine multiple anything-but conditions in AWS EventBridge event patterns? - Stack Overflow

programmeradmin3浏览0评论

I'm trying to create an AWS EventBridge rule, and I need to filter out events based on detail.type.

Each of these rules works separately:

Rule 1: This successfully filters out "foo-v2" and "bar-v2":

"detail": {
  "type": [{
    "anything-but": ["foo-v2", "bar-v2"]
  }]
}

Rule 2:

This successfully filters out anything containing datasync:

"detail": {
  "type": [{
    "anything-but": {
      "wildcard": "*datasync*"
    }
  }]
}

I've tried just about every different combination of these two but was not able to get one that was successful, does anyone have any advice on how I can combine both of these into one rule.

I'm trying to create an AWS EventBridge rule, and I need to filter out events based on detail.type.

Each of these rules works separately:

Rule 1: This successfully filters out "foo-v2" and "bar-v2":

"detail": {
  "type": [{
    "anything-but": ["foo-v2", "bar-v2"]
  }]
}

Rule 2:

This successfully filters out anything containing datasync:

"detail": {
  "type": [{
    "anything-but": {
      "wildcard": "*datasync*"
    }
  }]
}

I've tried just about every different combination of these two but was not able to get one that was successful, does anyone have any advice on how I can combine both of these into one rule.

Share Improve this question asked Feb 15 at 4:00 terrablterrabl 9243 gold badges11 silver badges24 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can use anything-but with wildcard and evaluate a set of items in a list.

Try adding just the wildcards for one of the items like the following:

"detail": {
  "type": [{
    "anything-but": {"wildcard": ["foo-v2", "bar-v2", "*datasync*"]}
          }]
          }

Comparison operators for use in event patterns in Amazon EventBridge

发布评论

评论列表(0)

  1. 暂无评论