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
Metadata
Release files for eks-token 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| eks_token-0.3.0.tar.gz | 11.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eks_token-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.1 kB
Release files / eks_token-0.3.0.tar.gz
| Download URL | eks_token-0.3.0.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92f3978b4c2d39dafc59c57e2392ecc7fc3b48713d04fae6a1c5e20054c2462b
|
|
BLAKE2b-256 checksum How to use checksums |
eda5b6cf192e901adc58280ab233bdd685282d7743d48509241684f713d4a5f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / eks_token-0.3.0-py3-none-any.whl
| Download URL | eks_token-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a5254fce761b0e2444dedb4cc32b601e4866b2f8aa2070f9d78abc4faf78f10
|
|
BLAKE2b-256 checksum How to use checksums |
f3fb5934f02ef5d18eb467079f8919847bb237c09e4c2d81728209bd79df2c28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|