Skip to content

Instantly share code, notes, and snippets.

@polds
Created September 9, 2015 17:00
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 polds/ee32d46fd7e8d8469ac6 to your computer and use it in GitHub Desktop.
Save polds/ee32d46fd7e8d8469ac6 to your computer and use it in GitHub Desktop.
salt vars from commands
{% set region_name = salt.cmd.run("curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F\" '{print $4}'") %}
{% set bucket_name = {
'us-east-1': 'aws-codedeploy-us-east-1',
'us-west-2': 'aws-codedeploy-us-west-2',
'eu-west-1': 'aws-codedeploy-eu-west-1',
'ap-southeast-2': 'aws-codedeploy-ap-southeast-2',
'ap-northeast-1': 'aws-codedeploy-ap-northeast-1',
}.get(region_name) %}
codedeploy-binary:
cmd.run:
- name: yes | aws s3 cp s3://{{ bucket_name }}/latest/install /opt --region {{ region_name }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment