you are here 🌎
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 |
Metadata
Release files for youarehere 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| youarehere-1.0.1.tar.gz | 8.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| youarehere-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.9 kB
Release files / youarehere-1.0.1.tar.gz
| Download URL | youarehere-1.0.1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c321baee5e41d27e9edb3d96894b458b1d3b31aa83bf75873deff174959b6297
|
|
BLAKE2b-256 checksum How to use checksums |
ad392bc6d130518879b88637ef9d122976d0b8db7e9deeb99a9c7ccd73d85fc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.9.7 Darwin/20.6.0
|
Release files / youarehere-1.0.1-py3-none-any.whl
| Download URL | youarehere-1.0.1-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfb0e4b5c9f12e503795142223e2eeac96a02391233bfc9f91516c1dbbb5284b
|
|
BLAKE2b-256 checksum How to use checksums |
0727dd519a0c6de7ea3060c18adb5bc901648aa9853fb0d953360bf84642148b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.9.7 Darwin/20.6.0
|