-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to retrieve EKS token #2331
Labels
feature-request
New feature or enhancement. May require GitHub community feedback.
p2
This is a standard priority issue
queued
This issues is on the AWS team's backlog
Comments
Vrtak-CZ
added
the
feature-request
New feature or enhancement. May require GitHub community feedback.
label
Apr 30, 2021
From my point of view there should be a similar command as https://docs.aws.amazon.com/cli/latest/reference/eks/get-token.html |
This is an important feature. @Vrtak-CZ do you have any workarounds? |
This feature is implemented in AWS CLI as a customization: aws/aws-cli#4141 |
I'll repost my gist, maybe someday it will be implemented (: import { SignatureV4 } from "@aws-sdk/signature-v4";
import { Sha256 } from "@aws-crypto/sha256-js";
import { fromEnv } from "@aws-sdk/credential-providers";
const signer = new SignatureV4({
credentials: fromEnv(),
region: process.env.AWS_REGION ?? "",
service: "sts",
sha256: Sha256,
});
const request = await signer.presign(
{
headers: {
host: `sts.${process.env.AWS_REGION}.amazonaws.com`,
"x-k8s-aws-id": "<cluster-id>",
},
hostname: `sts.${process.env.AWS_REGION}.amazonaws.com`,
method: "GET",
path: "/",
protocol: "https:",
query: {
Action: "GetCallerIdentity",
Version: "2011-06-15",
},
},
{ expiresIn: 0 }
);
const query = Object.keys(request?.query ?? {})
.map(
(q) =>
encodeURIComponent(q) +
"=" +
encodeURIComponent(request.query?.[q] as string)
)
.join("&");
const url = `https://${request.hostname}${request.path}?${query}`;
const token = "k8s-aws-v1." + Buffer.from(url).toString("base64url");
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature-request
New feature or enhancement. May require GitHub community feedback.
p2
This is a standard priority issue
queued
This issues is on the AWS team's backlog
Is your feature request related to a problem? Please describe.
For programatically access to EKS cluster resources (kubernetes api).
Describe the solution you'd like
Probably STS command for retrieving token.
The text was updated successfully, but these errors were encountered: