Sunday, September 17, 2017
Ubuntu Getting Started With AWS CLI
Ubuntu Getting Started With AWS CLI
Prerequisites
This has been tested on Ubuntu 12.04 and 14.04, but may also work on others.
Steps
Installation
Install the tools with the following commands:
sudo pip install awscli
Personal Configuration
If you just want to use this for a single account with manual commands (e.g. not scripts), then perform the following steps. If you want to configure this for multiple accounts and/or scripts, then it is probably best to run the "Setup For Scripts" section instead.
Run the following command and answer the questions
aws configure
Setup For Scripts
If you followed the previous section, then you do not need to run this one.
Now we need to set up our AWS credentials for automatic authentication
vim $HOME/.aws/config
File contents
aws_access_key_id = [ID HERE]
aws_secret_access_key = [KEY HERE]
region = eu-west-1
export AWS_CONFIG_FILE="`echo $HOME`/.aws/config"
Protect the file from other users who have access to the same machine.
Testing
You can test its working with a simple command t fetch the regions from AWS:
Now you can use the CLI to transfer files to and from s3 like so:
References
- GitHub - aws/aws-cli - Unable to locate credentials
- Installing aws-cli, the New AWS Command Line Tool
download file now