namecheap-domains-terraform-generator

command module
v0.0.0-...-e80cca0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

namecheap-domains-terraform-generator

Fetches Namecheap domains and generates Terraform configuration

Note: Currently, the project only supports domains that don't use Namecheap DNS for DNS management.

Usage

Set environment variables

export NAMECHEAP_USER_NAME="USER_NAME"
export NAMECHEAP_API_USER="API_USER" # Usually the same as 'NAMECHEAP_USER_NAME'
export NAMECHEAP_API_KEY="API_KEY"
export NAMECHEAP_CLIENT_IP="ALLOWED_IP_ADDRESS"
export NAMECHEAP_USE_SANDBOX="false" # Set this to 'true' when using sandbox

Build project

go build .

Run

./namecheap-domains-terraform-generator {TERRAFORM_OUTPUT_FILE_NAME}

Example

./namecheap-domains-terraform-generator main.tf

Expected output

2022/08/20 16:16:43 -> Wrote terraform resource for "example.com" domain
.....
2022/08/20 16:16:45 -> Successfully wrote all domain resources

File saved: "main.tf"
Terraform import command for the resources are as follows:

terraform import namecheap_domain_records.domain_example_com_1 example.com

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL