Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . eks ]

get-token

Description

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.

Synopsis

  get-token
--cluster-name <value>
[--role-arn <value>]

Options

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

Examples

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/v1alpha1",
  "spec": {},
  "status": {
    "expirationTimestamp": "2019-08-14T18:44:27Z",
    "token": "k8s-aws-v1EXAMPLE_TOKEN_DATA_STRING..."
  }
}