He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!
AWS CLI helps to manage and administrate AWS resources from the command line rather than opening up the AWS management console.
AWS CLI is very useful when you lot of automation tasks etc. For example, if you need to stop /start an EC2 instance every day, you can use AWS CLI for that. and place it in a cron job.
Check this link to setup aws cli in Linux.
If you see the above link it shows you how to configure aws cli for your aws account. Let’s say what you will do if you want to manage multiple aws accounts using AWS cli. Some people say reconfigure your aws cli. Reconfiguring AWS cli every time is going to a hectic job when you work parallelly for two different customers.
In order to resolve this issue AWS came with a solution of creating profiles. Where each aws access and secret key get associated with each profile.
Configuration
aws configure –profile <profile name>
then enter your corresponding access and secret key
then enter your corresponding access and secret key
Now I will show how to use this profile in real-time.
Let’s see if you want to list all the s3 buckets of customer1, use the below command
The only thing you need to add –profile key and its value to your every command. This lets aws cli to pick the corresponding AWS account.
happy learning 🙂
© 2020, Techrunnr. All rights reserved.