How to Setup SSO and aws-vault
SSO is used for Programatic access and to login to AWS console.
Open URL for SSO [https://domain.awsapps.com/start].
Use your SSO [username] and [password] to sign in.
Click on
Management console
to open AWS console or click onCommand line or programmatic access
for programmatic access.Â
After clicking on
Command line or programmatic access
use temporary keys by clicking onClick to copy these commands
and paste the credentials in terminal.Â
Another option is to use aws-vault with SSO.
Install aws-vault.
vim .aws/config
Paste the SSO config in the file:
[profile example-dev] sso_start_url=https://example.awsapps.com/start sso_region=us-west-1 sso_account_id=987654321 sso_role_name=AdministratorAccess region=us-west-1
Use
aws-vault exec
command to exec to AWS account. For example, to exec to example-dev useaws-vault exec example-dev
. This command redirects to web and waits for you to login to SSO and allow the request.
Â
After both options you will be able to exec to EKS cluster.
aws eks update-kubeconfig --name [cluster-name] --region [region-name]
Use this command to get all pods from all namespaces:
kubectl get pods -A
Use this command to exec to one of pods:
kubectl exec -it pod/[pod-name] /bin/bash