📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

eks-token

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eks-token

EKS Token package, an alternate to "aws eks get-token ..." CLI

0.3.0
PyPI
Maintainers
1

eks-token

EKS Token package, an alternate to "aws eks get-token ..." CLI

CodeQuality Publish stable

logo

Usage

Installation

pip install eks-token

Basic usage

from eks_token import get_token
from pprint import pprint

response = get_token(cluster_name='<value>')
pprint(response)

Expected Output

{'apiVersion': 'client.authentication.k8s.io/v1alpha1',
 'kind': 'ExecCredential',
 'spec': {},
 'status': {'expirationTimestamp': '2020-10-01T15:05:17Z',
            'token': 'k8s-aws-v1.<token_value>'}}

Extract token from response

from eks_token import get_token

token = get_token(cluster_name='value')['status']['token']
print(token)

Get Token signed for particular IAM role

Pass role_arn argument to the function

from eks_token import get_token

token = get_token(cluster_name='<value>', role_arn='<value>')['status']['token']
print(token)

Custom region

from eks_token import get_token

cluster_name = "your-cluster-name"
role_arn = "your-role-arn"
region_name = "your-region-name"

token = get_token(cluster_name, role_arn=role_arn, region_name=region_name)
print(token)

Contribution

Check our guidelines here

Keywords

eks k8s boto3 awscli python aws

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts