This Terraform provider lets you automate the management of Porkbun domains, DNS records, and other related resources.
Contributions are welcome! If you have suggestions or improvements, please open an issue or a pull request.
- Clone the repository.
- Navigate into the repository directory.
- Build the provider using the Go
installcommand:
go installTo 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 byPORKBUN_ACCTEST_DOMAIN. Use a test domain or a domain you can safely modify.
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" {}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)
- tuzzmaniandevil for the Porkbun API client.
- HashiCorp for the Terraform Plugin Framework and Terraform Provider Development Guide.