Associates an IAM policy with an EKS cluster to grant access to a specific namespace.

Terraform Template

resource "aws_eks_access_policy_association" "example" {

  access_scope {
    namespaces = ["example-namespace"]
    type = "namespace"
  }
  cluster_name = "aws_eks_cluster.example.name"
  policy_arn = "arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy"
  principal_arn = "aws_iam_user.example.arn"
}