This is the new AWS CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
AWS::EKS::AccessEntry
Creates an access entry.
An access entry allows an IAM principal to access your cluster. Access
            entries can replace the need to maintain entries in the aws-authConfigMap for authentication. You have the following options for
            authorizing an IAM principal to access Kubernetes objects on your cluster: Kubernetes
            role-based access control (RBAC), Amazon EKS, or both. Kubernetes RBAC authorization requires you
            to create and manage Kubernetes Role, ClusterRole,
                RoleBinding, and ClusterRoleBinding objects, in addition
            to managing access entries. If you use Amazon EKS authorization exclusively, you don't need
            to create and manage Kubernetes Role, ClusterRole,
                RoleBinding, and ClusterRoleBinding objects.
For more information about access entries, see Access entries in the Amazon EKS User Guide.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::EKS::AccessEntry", "Properties" : { "AccessPolicies" :[ AccessPolicy, ... ], "ClusterName" :String, "KubernetesGroups" :[ String, ... ], "PrincipalArn" :String, "Tags" :[ Tag, ... ], "Type" :String, "Username" :String} }
YAML
Type: AWS::EKS::AccessEntry Properties: AccessPolicies:- AccessPolicyClusterName:StringKubernetesGroups:- StringPrincipalArn:StringTags:- TagType:StringUsername:String
Properties
- AccessPolicies
- 
                    
                    The access policies to associate to the access entry. Required: No Type: Array of AccessPolicy Maximum: 20Update requires: No interruption 
- ClusterName
- 
                    The name of your cluster. Required: Yes Type: String Minimum: 1Update requires: Replacement 
- KubernetesGroups
- 
                    The value for namethat you've specified forkind: Groupas asubjectin a KubernetesRoleBindingorClusterRoleBindingobject. Amazon EKS doesn't confirm that the value fornameexists in any bindings on your cluster. You can specify one or more names.Kubernetes authorizes the principalArnof the access entry to access any cluster objects that you've specified in a KubernetesRoleorClusterRoleobject that is also specified in a binding'sroleRef. For more information about creating KubernetesRoleBinding,ClusterRoleBinding,Role, orClusterRoleobjects, see Using RBAC Authorization in the Kubernetes documentation. If you want Amazon EKS to authorize the principalArn(instead of, or in addition to Kubernetes authorizing theprincipalArn), you can associate one or more access policies to the access entry usingAssociateAccessPolicy. If you associate any access policies, theprincipalARNhas all permissions assigned in the associated access policies and all permissions in any KubernetesRoleorClusterRoleobjects that the group names are bound to.Required: No Type: Array of String Update requires: No interruption 
- PrincipalArn
- 
                    The ARN of the IAM principal for the AccessEntry. You can specify one ARN for each access entry. You can't specify the same ARN in more than one access entry. This value can't be changed after access entry creation.The valid principals differ depending on the type of the access entry in the typefield. ForSTANDARDaccess entries, you can use every IAM principal type. For nodes (EC2(for EKS Auto Mode),EC2_LINUX,EC2_WINDOWS,FARGATE_LINUX, andHYBRID_LINUX), the only valid ARN is IAM roles. You can't use the STS session principal type with access entries because this is a temporary principal for each session and not a permanent identity that can be assigned permissions.IAM best practices recommend using IAM roles with temporary credentials, rather than IAM users with long-term credentials. Required: Yes Type: String Minimum: 1Update requires: Replacement 
- 
                    Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or AWS resources. Required: No Type: Array of Tag Update requires: No interruption 
- Type
- 
                    The type of the new access entry. Valid values are STANDARD,FARGATE_LINUX,EC2_LINUX,EC2_WINDOWS,EC2(for EKS Auto Mode),HYBRID_LINUX, andHYPERPOD_LINUX.If the principalArnis for an IAM role that's used for self-managed Amazon EC2 nodes, specifyEC2_LINUXorEC2_WINDOWS. Amazon EKS grants the necessary permissions to the node for you. If theprincipalArnis for any other purpose, specifySTANDARD. If you don't specify a value, Amazon EKS sets the value toSTANDARD. If you have the access mode of the cluster set toAPI_AND_CONFIG_MAP, it's unnecessary to create access entries for IAM roles used with Fargate profiles or managed Amazon EC2 nodes, because Amazon EKS creates entries in theaws-authConfigMapfor the roles. You can't change this value once you've created the access entry.If you set the value to EC2_LINUXorEC2_WINDOWS, you can't specify values forkubernetesGroups, or associate anAccessPolicyto the access entry.Required: No Type: String Update requires: Replacement 
- Username
- 
                    The username to authenticate to Kubernetes with. We recommend not specifying a username and letting Amazon EKS specify it for you. For more information about the value Amazon EKS specifies for you, or constraints before specifying your own username, see Creating access entries in the Amazon EKS User Guide. Required: No Type: String Update requires: No interruption 
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource name. For example:
                        { "Ref": "arn:aws:iam::012345678910:role/my-role" }
                    
For the access entry arn:aws:iam::012345678910:role/my-role,
                Ref returns the ARN of the access entry.
For more information about using the Ref function, see Ref.
Fn::GetAtt
The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.
- AccessEntryArn
- 
                            The ARN of the access entry. 
Examples
Create an access entry
The following example creates an access entry of type STANDARD
                    for an IAM role named my-role. The role has
                    administrator permissions for all resources in the namespace named
                        my-namespace and edit permissions for all resources on the
                    cluster.
JSON
{ "myAccessEntry": { "Type" : "AWS::EKS::AccessEntry", "Properties" : { "ClusterName": "my-cluster", "PrincipalArn": "arn:aws:iam::012345678910:role/my-role", "Username": "admin", "KubernetesGroups": ["my-group1", "my-group2"], "AccessPolicies": [ { "PolicyArn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSAdminPolicy", "AccessScope": { "Type": "namespace", "Namespaces": ["my-namespace"] } }, { "PolicyArn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy", "AccessScope": { "Type": "cluster" } } ], "Type": "STANDARD", "Tags" : [ { "Key": "my-tagkey", "Value": "my-tagvalue" } ] } } }
YAML
MyAccessEntry: Type: 'AWS::EKS::AccessEntry' Properties: ClusterName: 'my-cluster' PrincipalArn: 'arn:aws:iam::012345678910:role/my-role' Username: 'admin' KubernetesGroups: - 'my-group1' - 'my-group2' AccessPolicies: - PolicyArn: 'arn:aws:eks::aws:cluster-access-policy/AmazonEKSAdminPolicy' AccessScope: Type: 'namespace' Namespaces: - 'my-namespace' - PolicyArn: 'arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy' AccessScope: Type: 'cluster' Type: 'STANDARD' Tags: - Key: 'my-tagkey' Value: 'my-tagvalue'
See also
- 
                    Access entries in the Amazon EKS User Guide . 
- 
                    CreateAccessEntryin the Amazon EKS API Reference.