Skip to content

Instantly share code, notes, and snippets.

@abby-fuller
Created July 18, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abby-fuller/81efa8375d1541b1b8b058f8764facff to your computer and use it in GitHub Desktop.
Save abby-fuller/81efa8375d1541b1b8b058f8764facff to your computer and use it in GitHub Desktop.
#configure awscli
- name: configure awscli
sudo: yes
shell: mkdir -p /home/vagrant/.aws && touch /home/vagrant/.aws/config
- name: change permissions
sudo: yes
shell: chmod -R 666 /home/vagrant/.aws/*
- name: create default config
sudo: yes
shell: echo "[default]" >> /home/vagrant/.aws/config
- name: add access key
sudo: yes
shell: echo "aws_access_key_id={{ ACCESS_KEY }}" >> /home/vagrant/.aws/config
- name: add secret key
sudo: yes
shell: echo "aws_secret_access_key={{ SECRET_ACCESS_KEY }}" >> /home/vagrant/.aws/config
- name: default to us-east-1
sudo: yes
shell: echo "region=us-east-1" >> /home/vagrant/.aws/config
- name: default to json. to use text, can switch to "output=text"
sudo: yes
shell: echo "output=json" >> /home/vagrant/.aws/config
- name: set config file location
sudo: yes
shell: echo 'AWS_CONFIG_FILE="/home/vagrant/.aws/config"' >> /etc/environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment