Resource: aws_eks_access_policy_association

Access Entry Policy Association for an EKS Cluster.

Example Usage

resource "aws_eks_access_policy_association" "example" {
  cluster_name  = aws_eks_cluster.example.name
  policy_arn    = "arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy"
  principal_arn = aws_iam_user.example.arn

  access_scope {
    type       = "namespace"
    namespaces = ["example-namespace"]
  }
}

Argument Reference

The following arguments are required:

access_scope Block

The access_scope block supports the following arguments.

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

associated_access_policy Block

The associated_access_policy block has the following attributes.

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import EKS add-on using the cluster_name, principal_arnand policy_arn separated by a colon (#). For example:

import {
  to = aws_eks_access_policy_association.my_eks_entry
  id = "my_cluster_name#my_principal_arn#my_policy_arn"
}

Using terraform import, import EKS access entry using the cluster_name principal_arn and policy_arn separated by a colon (#). For example:

% terraform import aws_eks_access_policy_association.my_eks_access_entry my_cluster_name#my_principal_arn#my_policy_arn