A quick and dirty script to dump out a FastDNS zone to terraform aws_route53_record
resources.
- Python 3 (tested on 3.7)
- edgegrid-python
- python-terrascript
While the code should work on both Python 2 and 3, python-terrascript only works on Python 3.
fastdns-to-terraform.py zone > zone.tf.json
Uses the default
section in ~/.edgerc
for auth. This can be customized using AKAMAI_EDGERC
and AKAMAI_EDGERC_SECTION
.
To launch it in docker, you'll need to make sure .edgerc
is present in the container:
docker pull bennettp123/fastdns-to-terraform
docker run --rm -it -v "$HOME/.edgerc:/root/.edgerc:ro" \
bennettp123/fastdns-to-terraform python fastdns-to-terraform.py zone
fastdns-to-terraform.py
prints its output in JSON format. You should pipe it through json2hcl
to convert it to HCL.