slick53

Python Interface to Route53
Download

slick53 Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Other/Proprietary Li...
  • Price:
  • FREE
  • Publisher Name:
  • Brad Carleton
  • Publisher web site:
  • http://github.com/bluepines/

slick53 Tags


slick53 Description

slick53 is a Python interface for AWS Route53.InstallationRun these commands to install:git clone git://github.com/bluepines/slick53.gitcd slick53sudo python setup.py installYou also need to set the following environment variables:export AWS_ACCESS_KEY_ID="< Insert your AWS Access Key >"export AWS_SECRET_ACCESS_KEY="< Insert your AWS Secret Key >"UsageI wrote this library to make dealing with Amazon's Route53 DNS service a lot easier. Now you can write code like the following:>>> from slick53 import route53>>> zone = route53.create_zone('example.com') # Creates the zone, example.com.>>> zone.add_a('example.com', '182.12.142.12') # Adds A record to the zone.>>> zone.add_cname('www.example.com', 'example.com') # Adds CNAME record to the zone.>>> zone.add_mx() # Adds MX records to the zone.Now what just happended. On line two we create the zone. Then we create an A record for the naked domain, followed by a cname for the ‘www’ subdomain which points back to the naked domain. Then we also added two MX records for our mail exchangers. Also, you don’t need to worry about trailing dots and fully qualified domain names, because that is handled automatically.Now, we can grab a list of all zones like this:>>> route53.get_zones() # Get all hosted zones.Or we can grab our individual zone by name:>>> zone = route53.get_zone('example.com')You can also look at what records you have in your zone:>>> for record in zone.get_records():... print record...< Record:A:example.com.: >< Record:CNAME:www.example.com.: >< Record:MX:example.com.: >< Record:NS:example.com.: >< Record:SOA:example.com. >And here is how you grab just the nameservers for your zone:>>> zone.get_nameservers() # Get nameservers for the zone.You add the nameservers to your domain registrar to actually switch to Amazon’s DNS service. I would recommend migrating a non-critical domain to start to make sure that you understand the process before moving your big domain with hundreds of records over to Route53.Now we can remove all these records and the zone itself like so:>>> zone = route53.get_zone('example.com') # Get the zone.>>> zone.delete_a('example.com') # Delete A record from the zone.>>> zone.delete_cname('www.example.com') # Delete CNAME record from the zone.>>> zone.delete_mx() # Delete MX records from the zone.>>> zone.delete() # Delete the zone itself.If anyone has any questions, bugs or issues then feel free to ask.Hopefully, this will make your life with Route53 significantly easier.Product's homepage


slick53 Related Software