Get a token for authentication with an Amazon EKS cluster. This can be used as an alternative to the aws-iam-authenticator.
See ‘aws help’ for descriptions of global parameters.
get-token
--cluster-name <value>
[--role-arn <value>]
--cluster-name
(string)
Specify the name of the Amazon EKS cluster to create a token for.
--role-arn
(string)
Assume this role for credentials when signing the token.
See ‘aws help’ for descriptions of global parameters.
Note
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
To get a cluster authentication token
This example command gets an authentication token for a cluster named example
.
Command:
aws eks get-token --cluster-name example
Output:
{
"kind": "ExecCredential",
"apiVersion": "client.authentication.k8s.io/v1beta1",
"spec": {},
"status": {
"expirationTimestamp": "2019-08-14T18:44:27Z",
"token": "k8s-aws-v1EXAMPLE_TOKEN_DATA_STRING..."
}
}