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"
    }
  ]
}
已提問 2 年前檢視次數 196 次
1 個回答
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
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南