AWS CLI - Install and Setup
Download the zip file:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Run the installer with sudo:
Alternatively, run the installer without root permissions and install to your home directory:
./aws/install -i ~/myaws
Verify that it is installed an that you can run commands by checking the version like this:
Your access key and credentials are going to be what you setup in the web console or through whatever authentication provider you are using.
If you don’t have something already setup for this and you just want to get up and running you can set this up quickly in IAM. Go to IAM, Users, “Add users”. Then either add them to an existing “admin” group, create a new group, or directly attach a policy. The policy “AdministratorAccess” should give you administrative access to everything which is good if you are the owner of the account and want to give yourself permission to test out anything you want without any restrictions.
Run the following command to setup your credentials and save them to a persistent file:
It will take parameters like this:
AWS Access Key ID : xxxxxxxxxxxxxxxxx AWS Secret Access Key: xxxxxxxxxxxxxxxxx Default region name: us-west-2 Default output format: json
Creds will be stored here:
Config info will be stored here:
Verify that you can access AWS with a query like this:
aws ec2 describe-instances
Alternatively, use these environment variables:
export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxx export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxx export AWS_DEFAULT_REGION=us-west-2 export AWS_DEFAULT_OUTPUT=json
You can create another profile like this:
aws configure --profile dev