Is there a way to create a policy (SCP) in AWS IAM that prevents tag creation with whitespace as a value?

  Kiến thức lập trình

I am trying to prevent tag creation with white space as a value on the following Tag “owner”

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Statement1",
      "Effect": "Deny",
      "Action": [
        "cloudformation:CreateStack"
      ],
      "Resource": [
        "*"
      ],
      "Condition": {
        "ForAllValues:StringNotEquals": {
          "aws:TagKeys": [
            "owner",
            "Owner"
          ]
        },
        "ForAllValues:StringEquals": {
          "aws:RequestTag/Owner": "* *"
        }
      }
    }
  ]
}

This still lets me create the tag with white space as a value.
Am I using the correct condition for this case? Thanks for any suggestions!

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT