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"
    }
  ]
}
feita há 2 anos213 visualizações
1 Resposta
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
respondido há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas