Categorygithub.com/leocomelli/asl
modulepackage
0.0.5
Repository: https://github.com/leocomelli/asl.git
Documentation: pkg.go.dev

# README

ASL ::: Amazon Single Sign-On Login

ASL is a cli to get the STS short-term credentials for all accounts and role names that is assigned to the AWS SSO user.

What does ASL do?

ASL retrieves and caches an AWS SSO access token to exchange for AWS credentials, when the cached access token expires, a new login is requested. Using a valid access token, the ASL lists all AWS accounts assigned to the user and then get the roles for each one. After that, the STS short-term credentials are stored in AWS credential file.

Prerequisites

Usage

Run the asl configure command to store the AWS SSO Login parameters to be used when needed. Whenever the AWS SSO access token needs to be renewed, these parameters are used.

asl configure \
  --account-id 123456789012 \
  --start-url https://d-123456w78w.awsapps.com/start/ \
  --role-name MyRoleSSOLogin \
  --region us-east-1

Run the asl command to store the STS short-term credentials for each account and role assigned to the user. You may safely rerun the asl command to refresh your credentials.

asl

Make sure everything works well

aws sts get-caller-identity --profile your-profile

EKS

Use the flag --eks to update the kubeconfig with all existing clusters in the accounts assigned to the user.

asl --eks

# Functions

Configure writes the ASL parameters to use when needed.
LoadConfig reads the ASL parameters.
NewEKS returns a new EKS.
NewFile returns a new File.
NewSSO returns a new SSO.
Snake converts text to use slash as a separator.

# Variables

BuildDate contains the date and time of build process.
GitHash contains the hash of last commit in the repository.
Version contains the current version of the app.

# Structs

Account defines the structure returned by AWS Cli.
AccountRole defines the structure returned by AWS Cli.
AccountRoles defines the structure returned by AWS Cli.
Accounts defines the structure returned by AWS Cli.
ConfigOptions defines the ASL options.
Credential defines the structure returned by AWS Cli.
CredentialResultInfo defines the information about SSO credentials.
Credentials defines the structure returned by AWS Cli.
EKS implements the flow to retrieve the EKS clusters configuration to use them with kubectl.
EKSCli implements commands to perform EKS actions through AWS Cli.
EKSClusters defines the structure returned by AWS Cli.
File represents the file options.
Options defines root command options.
SSO implements the flow to retrieve the AWS SSO credentials.
SSOCli implements commands to perform SSO actions through AWS Cli.
SSOCredential defines the structure returned by AWS Cli.

# Interfaces

EKSCommand represents the commands for interacting with EKS.
SSOCommand represents the commands for interacting with AWS SSO.