/fastdns-to-terraform

A quick and dirty python script to dump out a FastDNS zone to AWS terraform resources.

Primary LanguagePythonMIT LicenseMIT

fastdns-to-terraform

A quick and dirty script to dump out a FastDNS zone to terraform aws_route53_record resources.

Requirements

While the code should work on both Python 2 and 3, python-terrascript only works on Python 3.

Usage

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

HCL

fastdns-to-terraform.py prints its output in JSON format. You should pipe it through json2hcl to convert it to HCL.