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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ