Skip to content

Instantly share code, notes, and snippets.

@ryan-lane
Created June 3, 2014 01:12
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 ryan-lane/45816ae22390b28c06aa to your computer and use it in GitHub Desktop.
Save ryan-lane/45816ae22390b28c06aa to your computer and use it in GitHub Desktop.
Ensure myelb exists:
boto_elb.present:
- name: myelb
- availability_zones:
- us-east-1a
- listeners:
- elb_port: 80
instance_port: 8210
elb_protocol: HTTP
- elb_port: 443
instance_port: 8210
elb_protocol: HTTPS
instance_protocol: HTTP
certificate: 'arn:aws:iam::879879:server-certificate/mycert'
- health_check:
target: 'TCP:8210'
- profile: myprofile
# Fetch the ELB information so that we can get the DNS info from it.
{% set elb = salt['boto_elb.get_elb_config']('myelb', profile='myprofile') %}
# Ensure we only modify DNS if we got info about the ELB
{% if elb %}
Ensure myrecord.example.com cname points at ELB:
boto_route53.present:
- name: myrecord.example.com.
- zone: example.com.
- type: CNAME
- value: {{ elb.dns_name }}
{% endif %}
@ryan-lane
Copy link
Author

This of course doesn't work since jinja is rendered before the states. Sigh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment