aws-ezLogin is a script that automate the installation of AWS CLI (v2), create a profile for your IAM user (persistent cerdentials you are using to send API requests to AWS), and assume a role that your IAM user have access to. and all of those in a single command!
Download linux bash compatible script Download windows powershell compatible script
or
Clone the repo:
git clone git@github.com:Karuch/aws-ezLoginchmod +X cli-login.shMust be executed using source!
source ./cli-login.sh \
--aws-key <AccessKey> \
--aws-secret <SecretKey> \
--region <Region e.g il-central-1> \
--profile <IamUserName e.g talk> \
--role-name <roleName> \
--account-id <accountId e.g 012345678910>then you'll be asked to prompt the IAM user's MFA code. check you assumed the role successfully:
aws sts get-caller-identitymust be executed via powershell terminal! cmd might not work.
powershell -ExecutionPolicy Bypass -File .\cli-login.ps1 `
-awsKey <AccessKey> `
-awsSecret <SecretKey> `
-region <Region e.g. il-central-1> `
-profile <IamUserName e.g. talk> `
-roleName <roleName> `then you'll be asked to prompt the IAM user's MFA code.
if executed successfully a new profile should be created by the name of your IAM user you should be able to see it there:
aws configure list-profilesthen switch to the newly created profile:
$env:AWS_PROFILE = '<profile name>'check that you assumed the role successfully:
aws sts get-caller-identity- Fork the Project
- Create your Feature Branch (
git checkout -b feature/Feature) - Commit your Changes (
git commit -m 'Add some feature') - Push to the Branch (
git push origin feature/Feature) - Open a Pull Request
Distributed under the Apache License 2.0. See LICENSE.txt for more information.
Email: talk474747@gmail.com Linkedin: www.linkedin.com/in/tal-karucci Project Link: github.com/Karuch/aws-ezLogin