Support a custom Session Name for aws eks get-token
command
#8976
Labels
customization
Issues related to CLI customizations (located in /awscli/customizations)
eks-get-token
feature-request
A feature should be added or improved.
p2
This is a standard priority issue
Describe the feature
Add an option
--role-session-name
to be used in conjunction with the--role-arn
flag for theaws eks get-token
command.This flag would override the currently hard-coded role session name of
EKSGetTokenAuth
if provided.Use Case
Currently our organization uses the open source Leapp app to manage our role chaining and sessions. We are able to configure named sessions when authenticating to our EKS cluster, which allows us to identify authenticated users in the cluster for auditing and monitoring purposes.
Leapp's parent company has shut down and on top of that, we are exploring a new development platform where the Leapp desktop app is not supported.
One simple fix to this specific problem is supporting a custom role session name for the
aws eks get-token
, which is used in the~/.kube/config
file that is generated byaws eks update-kubeconfig
command.A snippet of the
~/.kube/config
file might look like this below. Note fields marked withXXXXXXXXXXX
are redacted.Currently, without being able specify a role session name for
aws eks get-token
, the identity information looks like this.Note the
Extra
fieldsessionName
is set toEKSGetTokenAuth
.Proposed Solution
Update the
STSClientFactory
class method_get_role_credentials
to add support for arole_session_name
parameter. If provided, it would override the default ofEKSGetTokenAuth
.Add
role-session-name
to theARG_TABLE
for this command.As far as the python code changes, they seem fairly small and straight forward, but I'm not familiar with the testing suite and so I am requesting this feature in the event that an existing maintainer can implement it (with tests) faster than I can.
Other Information
No response
Acknowledgements
CLI version used
aws-cli/2.18.0 Python/3.12.6 Linux/6.5.0-1025-azure exe/x86_64.ubuntu.20
Environment details (OS name and version, etc.)
GitHub Codespace (Linux codespaces-9d6cfb 6.5.0-1025-azure #26~22.04.1-Ubuntu SMP Thu Jul 11 22:33:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux)
The text was updated successfully, but these errors were encountered: