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년 전208회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠