Skip to content

Equivalent to aws eks get-token #6440

@devurandom

Description

@devurandom

Describe the feature

It would be nice if there was a AWS Java SDK equivalent of AWS CLI's aws eks get-token, which I could call to generate a (time-limited) Kubernetes API token for my Java process' current AWS identity similar to:

{
    "kind": "ExecCredential",
    "apiVersion": "client.authentication.k8s.io/v1beta1",
    "spec": {},
    "status": {
        "expirationTimestamp": "1970-01-01T00:00:00Z",
        "token": "k8s-aws-v1.[REDACTED]"
    }
}

Use Case

Authenticate to an AWS EKS cluster via its regular Kubernetes HTTP API, without having to create a permanent Kubernetes API token and pass it to the Java process that's already authenticated to AWS.

Proposed Solution

An officially sanctioned version of e.g. https://github.com/MrBergin/EksX or https://stackoverflow.com/questions/59853623/get-authentication-token-from-aws-eks-using-the-aws-java-sdk-v2.

Other Information

References: aws/aws-sdk-java#2737
References: aws/aws-sdk-java#1795
References: https://stackoverflow.com/questions/59853623/get-authentication-token-from-aws-eks-using-the-aws-java-sdk-v2
References: https://github.com/MrBergin/EksX

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

2.33.2

JDK version used

docker.io/library/eclipse-temurin:17.0.16_8-jre

Operating System and version

Linux 6.16

Metadata

Metadata

Assignees

Labels

feature-requestA feature should be added or improved.needs-reviewThis issue or PR needs review from the team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions