https://github.com/anubhavmishra/namecheap-domains-terraform-generator
Fetches Namecheap domains and generates Terraform configuration
https://github.com/anubhavmishra/namecheap-domains-terraform-generator
golang namecheap namecheap-api terraform
Last synced: 3 months ago
JSON representation
Fetches Namecheap domains and generates Terraform configuration
- Host: GitHub
- URL: https://github.com/anubhavmishra/namecheap-domains-terraform-generator
- Owner: anubhavmishra
- License: apache-2.0
- Created: 2022-08-20T21:55:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-21T04:05:32.000Z (almost 3 years ago)
- Last Synced: 2025-02-08T15:17:32.949Z (4 months ago)
- Topics: golang, namecheap, namecheap-api, terraform
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```bash
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
```bash
go build .
```Run
```bash
./namecheap-domains-terraform-generator {TERRAFORM_OUTPUT_FILE_NAME}
```Example
```bash
./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 resourcesFile saved: "main.tf"
Terraform import command for the resources are as follows:terraform import namecheap_domain_records.domain_example_com_1 example.com
```