eks-iam-auth
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

eks-iam-auth

Authenticate with AWS EKS clusters using AWS IAM.

When using the AWS CLI it's possible to set up kubectl such that it authenticates with your cluster using AWS IAM (docs). It is based on aws eks get-token (docs). Unfortunately no such option currently exists in aws-sdk-js.

Installation

yarn add eks-iam-auth

or

npm i eks-iam-auth

Usage

import { getBearerToken } from 'getBearerToken'
import { Client1_13 as Client } from 'kubernetes-client'
const client = new Client({
  config: {
    url: 'https://<endpoint>.eks.amazonaws.com',
    auth: {
      bearer: getBearerToken('<cluster-name>'),
    },
    insecureSkipTlsVerify: true,
  },
})
client.apis.apps.v1.deployments.get()

Currently only supports using AWS credentials from process.env.

License

eks-iam-auth is licensed under the terms of the MIT license.

Package Sidebar

Install

npm i eks-iam-auth

Weekly Downloads

17

Version

0.1.1

License

MIT

Unpacked Size

7.45 kB

Total Files

8

Last publish

Collaborators

  • kabo