Ubuntu:
sudo apt-get install -y python-pip
2. Issue the following command to install aws cli using pip
sudo pip install awscli
3. Create a .aws-config file in your $HOME path. eg /root/.aws-config
4. Copy the following credentials to the .aws-config file and enter you AWS access and secret key id in the required fields.
[default]aws_access_key_id = <You aws Access key id>ap-northeast-1,us-west-2 etc,,>
aws_secret_access_key = <Your AWS secret key id>
region = <aws region , eg:
5 . Set AWS_CONFIG_FILE environment variable using the following command.
export AWS_CONFIG_FILE=$HOME/.aws-config
aws ec2 describe-regions
RHEL/Centos:
sudo yum install -y python-pip
2. If your linux machine is on AWS, since pip is not in the localrepo , you have to install pip using the following commands
wget http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz --no-check-certificate
tar -xvf pip*.tar.gz
cd pip*
python setup.py install
3. Install aws cli using the following command.
pip install awscli
4. Use the following command to set up the configuration file for AWS credentials.
aws configure
5. The above command will ask you to enter the access key , secret key, region and ouput format. Once you provide the details, the config file will be automatically created in /root/.aws/config. you cna test the cli setup using the following command.
aws ec2 describe-regions
Windows:
aws configure
3. You will be promted to provide aws credentials, default region and output format. Once details are provided , it will configure awscli with your credentials.
4. Test AWS cli setup using the following command.
aws ec2 describe-regions
1 comment