AWS Tag policy not working

0

I am trying to test the following tag policy

{
  "tags": {
    "InfraOwner": {
      "tag_key": {
        "@@assign": "InfraOwner"
      },
      "tag_value": {
        "@@assign": [
          "ashish.sharma2@gmail.com"
        ]
      }
    }
  }
}

But it is not working as i can assign any random value for InfraOwner tag also Also please help to modify policy to use a wildcard to ensure that InfraOwner tag value should always end with @gmail.com

1 個回答
0

It sounds like the tag policy you have defined is not working as expected. Here are a few things to check:

Make sure that the tag policy is enabled. You can do this by navigating to the Tag policies page in the AWS Management Console and verifying that the policy is enabled.
Verify that the policy is applied to the correct resources. Tag policies only apply to resources that are created or modified after the policy is enabled.
Check the syntax of the policy. The policy you provided looks correct, but it's possible that there is a syntax error or typo that is causing the policy to fail.

Regarding your second question, you can modify the policy to use a wildcard to ensure that the InfraOwner tag value always ends with "@gmail.com". Here's an example policy that does this:


{
  "tags": {
    "InfraOwner": {
      "tag_key": {
        "@@assign": "InfraOwner"
      },
      "tag_value": {
        "@@endsWith": "@gmail.com"
      }
    }
  }
}
  • This policy uses the "@@endsWith" condition operator to ensure that the InfraOwner tag value ends with "@gmail.com".

  • Note that this policy will only allow values that end with "@gmail.com", so if you want to allow other email domains as well, you will need to modify the policy accordingly.

if this answer helps, please ensure to leave a thumbs up.

I hope this helps! Let me know if you have any further questions.

profile pictureAWS
已回答 1 年前

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

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

回答問題指南