Route53 DNS utility

aws, boto3, dns, route53
pip install youarehere==1.0.1


you are here 🌎

PyPI - License PyPI

Somehow, adding a new record to Route53 takes 100 lines of Python. So now it only takes one.

>>> from youarehere import create_record
>>> create_record("A", "", "")

You can also easily point a record to the current machine:

>>> from youarehere import point_record_to_here
>>> point_record_to_here("")

use case

You have a Raspberry Pi that travels around and you want to keep a pointer to it in Route53. Add this as a cron-job:

$ python3 -c "point_record_to_here('')"

create_record Arguments

Argument Type Default Description
record_type str The type of the record to add (e.g. A, CNAME, etc). For an exhaustive list, see youarehere.VALID_RECORD_TYPES.
name str The DNS record name (e.g. "")
destination str / List[str] The destination IP or values (e.g. ["", ""]). If you provide a single string, it will be treated as an Array[1].
hosted_zone_id str None ID of the hosted zone to which to add this record. Guess automatically by default, or use youarehere.guess_hosted_zone_id_for_name.
comment str "" An optional comment for the change request (e.g. "Baby's first DNS record!")
ttl int 300 The TTL for your record; defaults to 300 which is probably too low.

Documentation auto-generated with docshund, bork bork. 🐕

CLI Usage


Point '' to the current machine:

$ youarehere

Point '' to the IP

$ youarehere

Point '' to a set of IPs in descending order, with a TTL of 6000 seconds.

$ youarehere, --ttl 6000
Argument Description
name Record to add (e.g. "")
destination IP destination. Default: Current global IP.
Flag Description
--type (A) The type of record to add
--ttl (300) The TTL of the new DNS record
--dry-run (False) Print and quit without making changes