Skip to content

Instantly share code, notes, and snippets.

View OndraZizka's full-sized avatar
🍊

Ondrej Zizka OndraZizka

🍊
View GitHub Profile
@jawnb
jawnb / populate_dns.py
Created August 12, 2011 03:35
Script to populate route53 DNS records from ec2 instance id and instance names.
#!/usr/bin/env python
import boto
from boto.route53.record import ResourceRecordSets
import logging
conn = boto.connect_ec2()
DNS_EXCLUSION_TAG = 'ExcludeFromDNS' # If this tag exists on an instance, no DNS values will be populated
DNS_TAGS = ['ShortName', 'Name'] # This is the list of instance tags we want to populate DNS entries from
DNS_SUFFIX = 'YOUR_SUBDOMAIN_HERE' # Suffix under which to create DNS records
ROUTE53_ZONE_ID = 'YOUR_ZONE_ID_HERE' # The zone id from route53 of the zone we will be adding these entries under