IAM policy to deny EKS cluster creation with public access

, ,

{
“Version”: “2012-10-17”,
“Statement”: [
{
“Sid”: “EKSNoPublicAccess”,
“Effect”: “Deny”,
“Action”: [
“eks:CreateCluster”,
“eks:UpdateClusterConfig”
],
“Resource”: “*”,
“Condition”: {
“Bool”: {
“eks:ResourcesVpcConfig:EndpointPublicAccess”: true
}
}
}
]
}

Hi,

My goal is to create an IAM policy rule that prevents clusters being created with public access. The above isn’t it…any pointers appreciated.

Thanks!


Related discussions:

‘CreateCluster’ and updateclusterConfig both don’t support any conditions which you have mentioned below.
You could create a detective control instead using either Config or Cloudwatch event rules to take down/update the cluster if the configuration isn’t as it should be

boo but thanks!

yeah, this is not good enough - we need something to prevent it at the api action layer and not after the fact.

Only thing I have managed to come up with tangibly is enforcing OPA policy into IDE and pipelines but what a long way round to do what should be a simple API Action condition.