Name
zonefile-migrate - Migrate DNS managed zones
Synopsis
zonefile-migrate to-cloudformation [OPTIONS] [SRC]... DST
zonefile-migrate to-terraform [OPTIONS] [SRC]... DST
Options
to-cloudformation
--sceptre-group DIRECTORY to write sceptre stack group configuration
--maximum-ttl INTEGER maximum TTL of domain name records
to-terraform
--maximum-ttl INTEGER maximum TTL of domain name records
--provider PROVIDER to generate for
Description
Converts one or more SRC zonefiles into AWS CloudFormation
or Terraform templates in DST.
The zonefiles must contain a $ORIGIN and $TTL statement. If the SRC points to a directory all files which contain one of these statements will be converted. If a $ORIGIN is missing, the name of the file will be used as the domain name.
Optionally generates the Sceptre stack config for each of the
templates in the --sceptre-group directory.
Each generated CloudFormation template contains a single Route53 HostedZone and all associated ResourceRecordSet. The SOA and NS records for the origin domain are not copied into the template.
Installation
to install the utility, type:
pip install zonefile-migrate
Example - to-cloudformation
In the source code we have an example, to try it out, type:
$ git clone https://gitlab.com/binxio/zonefile-migrate.git
$ cd zonefile-migrate/example
$ zonefile-migrate to-cloudformation --sceptre-group config/dns ./zones ./templates/dns
INFO: reading zonefile zones/asample.org
INFO: reading zonefile zones/land-5.com
To deploy all the managed zones to AWS, type:
$ sceptre --var aws_profile=$AWS_PROFILE launch -y dns
[2022-05-14 14:58:23] - dns/zone-land-5-com - Launching Stack
[2022-05-14 14:58:23] - dns/zone-example-org - Launching Stack
[2022-05-14 14:58:23] - dns/zone-land-5-com - Stack is in the PENDING state
[2022-05-14 14:58:23] - dns/zone-land-5-com - Creating Stack
[2022-05-14 14:58:23] - dns/zone-asample-org - Stack is in the PENDING state
[2022-05-14 14:58:23] - dns/zone-asample-org - Creating Stack
[2022-05-14 14:58:24] - dns/zone-asample-org binxio-dns-zone-asample-org AWS::CloudFormation::Stack CREATE_IN_PROGRESS User Initiated
[2022-05-14 14:58:24] - dns/zone-land-5-com binxio-dns-zone-land-5-com AWS::CloudFormation::Stack CREATE_IN_PROGRESS User Initiated
...
Example - to-terraform
$ git clone https://gitlab.com/binxio/zonefile-migrate.git
$ cd zonefile-migrate/example
$ zonefile-migrate to-terraform --provider google ./zones ./terraform
INFO: reading zonefile zones/asample.org
INFO: reading zonefile zones/land-5.com
To deploy all the managed zones to Google Cloud Platform, type:
$ cd terraform
$ terraform init
$ export GOOGLE_PROJECT=$(gcloud config get-value core/project)
$ terraform apply -auto-approve
...
Terraform will perform the following actions:
# module.asample_org.google_dns_managed_zone.managed_zone will be created
+ resource "google_dns_managed_zone" "managed_zone" {
+ description = "Managed by Terraform"
+ dns_name = "asample.org."
+ force_destroy = false
+ id = (known after apply)
+ name = "asample-org"
+ name_servers = (known after apply)
+ project = (known after apply)
+ visibility = "public"
}
...
Plan: 49 to add, 0 to change, 0 to destroy.
module.land-5_com.google_dns_managed_zone.managed_zone: Creating...
module.asample_org.google_dns_managed_zone.managed_zone: Creating...
...
Metadata
Release files for zonefile-migrate 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zonefile-migrate-0.4.4.tar.gz | 13.6 kB | Without provenance | Details for zonefile-migrate-0.4.4.tar.gz |
Release files / zonefile-migrate-0.4.4.tar.gz
| Download URL | zonefile-migrate-0.4.4.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b83ae8b8bad3dff28ad7cb4a84868fdf894d6cb5aa815df256f5b81ab5bac797
|
|
BLAKE2b-256 checksum How to use checksums |
e11bda79fcf1159704c2b87252efbcb680e1b9b484ae6c2fad8f6ed42b9a6d04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.13
|
Security for zonefile-migrate 0.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.