Skip to main content

Route53 DNS utility

Project description

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", "foo.example.com", "4.4.4.4")

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

>>> from youarehere import point_record_to_here
>>> point_record_to_here("foo.example.com")

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('my-pi.example.com')"

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. "foo.example.com")
destination str / List[str] The destination IP or values (e.g. ["4.4.4.4", "8.8.8.8"]). 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

Examples:

Point 'test.example.com' to the current machine:

$ youarehere test.example.com

Point 'test.example.com' to the IP 93.184.216.34

$ youarehere test.example.com 93.184.216.34

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

$ youarehere test.example.com 93.184.216.34,93.184.216.35 --ttl 6000
Argument Description
name Record to add (e.g. "test.example.com")
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

youarehere-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

youarehere-1.0.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file youarehere-1.0.0.tar.gz.

File metadata

  • Download URL: youarehere-1.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/2.7.15 Darwin/18.7.0

File hashes

Hashes for youarehere-1.0.0.tar.gz
Algorithm Hash digest
SHA256 56560c908c0ded26d5bccc89fce225a71031b7a3034f9a1e5afb165120abe1a2
MD5 544d37fd64e9999ad9a0572c3e3cbbf3
BLAKE2b-256 d79b133d96c9201e8e1ac3e4b2dd68df44fe54b6c21c8d53e70d243d89d91e80

See more details on using hashes here.

File details

Details for the file youarehere-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: youarehere-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/2.7.15 Darwin/18.7.0

File hashes

Hashes for youarehere-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4078b8dbc364cbfb1c27a8083ec4d7d7803669cf5bbda5598f02782815d3a0e
MD5 7c949e19d58a13706826df3771a3568f
BLAKE2b-256 525111537bd9c610dff754de9b52d9c534344ffcf6d819fa8830792dde1b0390

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page