Code Monkey home page Code Monkey logo

update-route53's Introduction

update-route53

Build Status codecov

Updates route53 for a name and IP address. This was designed to allow a machine with a floating IP address to self-update its hostname.

To build

python3 -m venv venv
source venv/bin/activate
pip install wheel setuptools -U
python setup.py sdist bdist_wheel

to install once built

deactivate
sudo pip3 install dist/update_route53-0.0.1-py3-none-any.whl

To install in crontab

sudo crontab -e

## I place my env variables above the descriptive comments in the crontab
AWS_ACCESS_KEY_ID=AKIA**********
AWS_SECRET_ACCESS_KEY=********************
DNSNAME=subdomain.mydomain.com

# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
18 * * * * /usr/local/bin/update-route53 ${DNSNAME} >>/var/log/update-route53.log 2>>/var/log/update-route53.error

The above runs 18 minutes past the hour. Consider picking a random number between 0-59. My old boss preferred prime number intervals between all services. This makes your job easier if your system ever displays periodic instability. If your periodic tasks all start on the hour, isolating the cause of problems is slightly harder. In this case, I'm just thinking of the poor guy running the IP echo service this code is hitting. Spread that load out.

To test

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python -m unittest

AWS setup

I have included an example IAM policy in conf/aws/route53-updater-policy.json. I suggest creating a user that has no permissions other than this policy, and using those permissions with the script/service. Note, do NOT ever install a policy you haven't audited yourself. Please take a look at it and look up the associated permissions.

update-route53's People

Contributors

ccoakley avatar

Stargazers

Virgil avatar Ryan Chausse avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

end18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.