Skip to content

CLI script to create temporary AWS credentials based on EKS IAM Roles for Service Accounts for tools which can't be easily migrated to a newer AWS SDK.

License

bolindalabs/awstokengen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

awstokengen

CLI script to create temporary AWS credentials based on EKS IAM Roles for Service Accounts for tools which can't be easily migrated to a newer AWS SDK.

Usage

# set AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN environment variable,
# based on the IAM Role referenced in the Kubernetes Service Account.
eval $(awstokengen)

./yourTool # now uses environment variables to authenticate against AWS.

Available CLI flags:

  • -exitNoEks (default=false) if IAM Role for Service Accounts environment variables are not detected, exit without error
  • -region (default=us-east-1) AWS Region to make requests to
  • -sessionName (default=new UUID()) if set will be used as role session name. Session Arn will be in format arn:aws:sts:::assumed-role/$AWS_ROLE_ARN/

About

CLI script to create temporary AWS credentials based on EKS IAM Roles for Service Accounts for tools which can't be easily migrated to a newer AWS SDK.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •