Use AWS CLI With Azure SSO
Description:
Using AWS CLI is pretty straight forward and you can just follow the guides to setup and use, but what if your organization uses Azure SSO and you need to administer AWS? Well, here are the steps I have done to get through authentication. Many thanks to a reddit comment from /u/myron-semack/ for getting me started.
To Resolve:
-
Install AWS CLI, Node, and aws-azure-login:
-
Configure your profile
- Open Powershell and run:
aws-azure-login --configure
- If you want to setup multiple profiles, you can run
aws-azure-login --configure --profile profilename
1 2 3 4 5 6 7 8
Configuring profile 'default' ? Azure Tenant ID: some-guid-for-your-organization ? Azure App ID URI: https://signin.aws.amazon.com/saml ? Default Username: yourEmail@domain.com ? Stay logged in: skip authentication while refreshing aws credentials (true|false) true ? Default Role ARN (if multiple): get-your-arn-based-on-role (maybe you can leave blank? format is normally arn:aws:iam::############:role/role-name) ? Default Session Duration Hours (up to 12): 1 Profile saved.
- Open Powershell and run:
-
Login:
- Open Powershell and run:
aws-azure-login
- After a period of time, your credentials will expire and you will have to run aws-azure-login again. The time period will vary depending on inactivity, but it is typically several hours or days.
- Open Powershell and run:
-
Now you can run things like
aws ec2 describe-instances
and so on and it should be authenticated.
Comments