resource "aws_organizations_policy" "tag_enforcement_eks" {
name = "tag_enforcement_eks"
content = <<EOT
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Deny if org:bu absent",
"Effect": "Deny",
"Action": [
"eks:CreateNodegroup",
"eks:CreateCluster"
],
"Resource": "*",
"Condition": {
"StringNotLike": {
"aws:RequestTag/org:bu": ${jsonencode(var.bu)}
}
}
},
{
"Sid": "Deny if org:zone absent",
"Effect": "Deny",
"Action": [
"eks:CreateNodegroup",
"eks:CreateCluster"
],
"Resource": "*",
"Condition": {
"StringNotLike": {
"aws:RequestTag/org:zone": ${jsonencode(var.zone)}
}
}
},
{
"Sid": "Deny if org:team absent",
"Effect": "Deny",
"Action": [
"eks:CreateNodegroup",
"eks:CreateCluster"
],
"Resource": "*",
"Condition": {
"StringNotLike": {
"aws:RequestTag/org:team": ${jsonencode(var.team)}
}
}
},
{
"Sid": "Deny if org:cluster absent",
"Effect": "Deny",
"Action": [
"eks:CreateNodegroup",
"eks:CreateCluster"
],
"Resource": "*",
"Condition": {
"StringNotLike": {
"aws:RequestTag/org:cluster": ${jsonencode(var.cluster)}
}
}
}
]
}
EOT
}
MalformedPolicyDocumentException: The provided policy document does not meet the requirements of the specified policy type. Creating a Service Control Policy, I see the code to be correct, cant verify where is the problem. Can anyone help me out?
Where is the error?