Created
July 16, 2014 17:58
-
-
Save zircote/338452dddbaa8590bc03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from boto import route53 | |
r53 = route53.connect_to_region(region_name='us-east-1') | |
dev_aws = r53.get_zone('my-domain.local') | |
with open('hosts') as host: | |
i = 0 | |
rrs = route53.record.ResourceRecordSets(r53, dev_aws.id) | |
for line in host.readlines(): | |
line = line.strip() | |
parts = line.split(',') | |
c = rrs.add_change("UPSERT", parts[1], "A") | |
c.add_value(parts[0]) | |
if i >= 3999: | |
rrs.commit() | |
rrs = route53.record.ResourceRecordSets(r53, dev_aws.id) | |
i = 0 | |
i += 1 | |
rrs.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment