Cost category expression with compound dimension using OR

0

Writing cost category rule expressions, I want to create a compound expression such that the rule matches tag X equals A OR tag Y equals B. How can this be done (via the json editor as the expression builder doesn't support compound expressions)? I get an error saying root expression must be AND - is there a workaround to this?

{
  "RuleVersion": "CostCategoryExpression.v1",
  "Rules": [
    {
      "Rule": {
        "Or": [
          {
            "Tags": {
              "Key": "X",
              "MatchOptions": [
                "STARTS_WITH"
              ],
              "Values": [
                "A"
              ]
            }
          },
          {
            "Tags": {
              "Key": "Y",
              "MatchOptions": [
                "STARTS_WITH"
              ],
              "Values": [
                "B"
              ]
            }
          }
        ]
      },
      "Type": "REGULAR",
      "Value": "example"
    }
  ]
}
gefragt vor 2 Jahren213 Aufrufe
1 Antwort
0

I found a workaround in the UI where you simply create a new rule that outputs the same value. So it would be value=teamA where accounts = account1 and account2. Then add a new rule that also outputs value=team1 but the dimensions are when service=EKS or tag=teamalpha.

AWS
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen