EKS Token package, an alternate to "aws eks get-token ..." CLI
Project description
eks-token
EKS Token package, an alternate to "aws eks get-token ..." CLI
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
eks_token-0.3.0.tar.gz
(11.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
eks_token-0.3.0-py3-none-any.whl
(12.2 kB
view details)
File details
Details for the file eks_token-0.3.0.tar.gz.
File metadata
- Download URL: eks_token-0.3.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92f3978b4c2d39dafc59c57e2392ecc7fc3b48713d04fae6a1c5e20054c2462b
|
|
| MD5 |
7edc2288f3ec2fecaa7d432b97468ca3
|
|
| BLAKE2b-256 |
eda5b6cf192e901adc58280ab233bdd685282d7743d48509241684f713d4a5f5
|
File details
Details for the file eks_token-0.3.0-py3-none-any.whl.
File metadata
- Download URL: eks_token-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a5254fce761b0e2444dedb4cc32b601e4866b2f8aa2070f9d78abc4faf78f10
|
|
| MD5 |
2a61cc5e3663a4d119b4d7b8c567ec23
|
|
| BLAKE2b-256 |
f3fb5934f02ef5d18eb467079f8919847bb237c09e4c2d81728209bd79df2c28
|