Friday, March 8, 2013

Backup of Route53 zones using Command Line tool (cli53)

This is my First Blog & hope to publish many more like these in the times to come.....!!!!!

As most of you might be aware about Route53 (one of the key AWS Product)

For those being an alien to the Amazon world here is a short brief on Route 53

Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service. It is designed to give developers and businesses an extremely reliable and cost effective way to route end users to Internet applications by translating human readable names like www.example.com into the numeric IP addresses like 192.0.2.1 that computers use to connect to each other.
Without wasting any more time I would be directly jumping to the Configuration Part.

# yum -y install python-pip*

pip (Python Package Index) is a tool for installing and managing Python packages.
# yum -y install python-boto

boto: A Python interface to Amazon Web Services

# pip install cli53

cli53 - Command line script to administer the Amazon Route 53 dns service
Create a boto file e.g /root/.boto with following entries.
[Credentials]

aws_access_key_id = Access key for cloud account instance

aws_secret_access_key = Secret key for cloud account instance

[Boto]

debug = 0

num_retries = 10

Here, I have set debug value to 0 (disabled) in case you want enable debugging for boto set debug = 1
num_retries refers the number of times the Python interface will try to connect or access Amazon Web Service (AWS) 

Synchronization of Time is one of the key parameters for the interaction of cli53 to AWS in order to establish a connectivity to AWS account zone


# yum install ntpdate -y

# ntpdate pool.ntp.org

Now we are all set & ready to go......

The cli python script would get created in /usr/bin
To get the list of Hosted Domains on Route53 write command.

# cli53 list                            (
lists all the hosted domains on your AWS account)

For more help on cli53 commands

# cli53 --help                          (shows below mentioned arguments)

    list                list hosted zones
    info                get details of a hosted zone
    export              export dns in bind format
    import              import dns in bind format
    create              create a hosted zone
    delete              delete a hosted zone
    rrcreate            create a resource record
    rrdelete            delete a resource record
    rrpurge             purge all resource records
    rrlist              list all resource records

# cli53 info domain_name            (gives info about the domain)
 
For example, # cli53 info ankush.com 
# cli53 rrlist ankush.com             (list all resource records for ankush.com)


I hope this blog is LIKED by All.......Keep Smiling

 


4 comments:

Renew k8s certificates

Check If certificate expires: amikum@~:03:06:54(⎈ |local-cluster:default):sudo kubeadm certs check-expiration CERTIFICATE                EXP...