Skip to content

marcfrederick/terraform-provider-porkbun

Repository files navigation

Terraform Provider Porkbun

License Tests Go Report Card Latest Release Terraform Downloads

This Terraform provider lets you automate the management of Porkbun domains, DNS records, and other related resources.

Contributing

Contributions are welcome! If you have suggestions or improvements, please open an issue or a pull request.

Requirements

Building the Provider

  1. Clone the repository.
  2. Navigate into the repository directory.
  3. Build the provider using the Go install command:
go install

Acceptance Testing

To run acceptance tests, you need:

  • A valid Porkbun API key and secret
  • A registered domain for testing

Set the required environment variables:

export PORKBUN_API_KEY="your_api_key"
export PORKBUN_SECRET_API_KEY="your_secret_api_key"
export PORKBUN_ACCTEST_DOMAIN="example.com"

Run the tests with:

make acctest

⚠️ During testing, the provider will create and destroy resources in the domain specified by PORKBUN_ACCTEST_DOMAIN. Use a test domain or a domain you can safely modify.

Using the Provider Locally

To test the provider locally, configure Terraform to use your local build by adding the following to your ~/.terraformrc file. Replace <GOBIN> with the actual path, which you can find by running go env GOBIN:

provider_installation {
  dev_overrides {
    "registry.terraform.io/marcfrederick/porkbun" = "<GOBIN>"
  }
  direct {}
}

Then, create a new Terraform configuration file (e.g., main.tf) with the following:

terraform {
  required_providers {
    porkbun = {
      source  = "marcfrederick/porkbun"
      version = ">= 0.1.0"
    }
  }
}

provider "porkbun" {}

Related Projects

Other existing Terraform providers for Porkbun support different subsets of the API. Here are some of them:

  • cullenmcdermott/porkbun
    • porkbun_dns_record (Resource)
  • kyswtn/porkbun
    • porkbun_dns_record (Resource)
    • porkbun_nameservers (Resource)
    • porkbun_nameservers (Data Source)
  • developing-today-forks/porkbun
    • porkbun_dns_record (Resource)
  • jianyuan/porkbun
    • porkbun_dns_record (Resource)
    • porkbun_domain_nameservers (Resource)
    • porkbun_dns_record (Data Source)
    • porkbun_dns_records (Data Source)
    • porkbun_domain_nameservers (Data Source)
    • porkbun_domains (Data Source)
  • flooopro/porkbun
    • porkbun_dns_record (Resource)
    • porkbun_dnssec_record (Resource)
    • porkbun_domain_nameservers (Resource)
    • porkbun_glue_record (Resource)
    • porkbun_dns_records (Data Source)
    • porkbun_domains (Data Source)

Acknowledgements

About

Terraform provider to manage Porkbun domains, DNS records, and other related resources.

Topics

Resources

License

Stars

Watchers

Forks

Contributors