Skip to main content

access_entries

Creates, updates, deletes, gets or lists an access_entries resource.

Overview

Nameaccess_entries
TypeResource
Idaws.eks.access_entries

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_entry_arnstringThe ARN of the access entry.
cluster_namestringThe name of your cluster.
created_atstring (date-time)The Unix epoch timestamp at object creation.
kubernetes_groupsarrayA name that you've specified in a Kubernetes RoleBinding or ClusterRoleBinding object so that Kubernetes authorizes the principalARN access to cluster objects.
modified_atstring (date-time)The Unix epoch timestamp for the last modification to the object.
principal_arnstringThe ARN of the IAM principal for the access entry. If you ever delete the IAM principal with this ARN, the access entry isn't automatically deleted. We recommend that you delete the access entry with an ARN for an IAM principal that you delete. If you don't delete the access entry and ever recreate the IAM principal, even if it has the same ARN, the access entry won't work. This is because even though the ARN is the same for the recreated IAM principal, the roleID or userID (you can see this with the Security Token Service GetCallerIdentity API) is different for the recreated IAM principal than it was for the original IAM principal. Even though you don't see the IAM principal's roleID or userID for an access entry, Amazon EKS stores it with the access entry.
tagsobjectMetadata 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 Amazon Web Services resources.
type_stringThe type of the access entry.
usernamestringThe name of a user that can authenticate to your cluster.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_access_entryselectname, principal_arn, regionDescribes an access entry.
list_access_entriesselectname, regionassociatedPolicyArn, maxResults, nextTokenLists the access entries for your cluster.
create_access_entryinsertname, region, principalArnCreates 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-auth ConfigMap 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.
update_access_entryupdatename, principal_arn, regionUpdates an access entry.
delete_access_entrydeletename, principal_arn, regionDeletes an access entry. Deleting an access entry of a type other than Standard can cause your cluster to function improperly. If you delete an access entry in error, you can recreate it.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
namestringThe name of your cluster.
principal_arnstringThe ARN of the IAM principal for the AccessEntry.
regionstringAWS region (default: us-east-1)
associatedPolicyArnstringThe ARN of an AccessPolicy. When you specify an access policy ARN, only the access entries associated to that access policy are returned. For a list of available policy ARNs, use ListAccessPolicies.
maxResultsintegerThe maximum number of results, returned in paginated output. You receive maxResults in a single page, along with a nextToken response element. You can see the remaining results of the initial request by sending another request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, 100 results and a nextToken value, if applicable, are returned.
nextTokenstringThe nextToken value returned from a previous paginated request, where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This token should be treated as an opaque identifier that is used only to retrieve the next items in a list and not for other programmatic purposes.

SELECT examples

Describes an access entry.

SELECT
access_entry_arn,
cluster_name,
created_at,
kubernetes_groups,
modified_at,
principal_arn,
tags,
type_,
username
FROM aws.eks.access_entries
WHERE name = '{{ name }}' -- required
AND principal_arn = '{{ principal_arn }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

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-auth ConfigMap 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.

INSERT INTO aws.eks.access_entries (
principalArn,
kubernetesGroups,
tags,
clientRequestToken,
username,
type,
name,
region
)
SELECT
'{{ principalArn }}' /* required */,
'{{ kubernetesGroups }}',
'{{ tags }}',
'{{ clientRequestToken }}',
'{{ username }}',
'{{ type }}',
'{{ name }}',
'{{ region }}'
RETURNING
access_entry
;

UPDATE examples

Updates an access entry.

UPDATE aws.eks.access_entries
SET
kubernetesGroups = '{{ kubernetesGroups }}',
clientRequestToken = '{{ clientRequestToken }}',
username = '{{ username }}'
WHERE
name = '{{ name }}' --required
AND principal_arn = '{{ principal_arn }}' --required
AND region = '{{ region }}' --required
RETURNING
access_entry;

DELETE examples

Deletes an access entry. Deleting an access entry of a type other than Standard can cause your cluster to function improperly. If you delete an access entry in error, you can recreate it.

DELETE FROM aws.eks.access_entries
WHERE name = '{{ name }}' --required
AND principal_arn = '{{ principal_arn }}' --required
AND region = '{{ region }}' --required
;