This Terraform provider allows for the management of MultiCDN configurations through Terraform. It currently supports two resource types:
- CDN Configuration Resources
- Preference Resources
Clone the repository and build the provider:
git clone <repository-url>
cd terraform-provider-constellix-multicdn
make buildTo install the provider for local development:
make installThis will build and install the provider to ~/.terraform.d/plugins/registry.terraform.io/constellix/constellix-multicdn/0.0.1/darwin_arm64/.
Run the unit tests:
make testRun the acceptance tests (requires API access):
make testaccThe provider requires authentication to access the MultiCDN API:
provider "multicdn" {
api_key = "your-api-key"
api_secret = "your-api-secret"
base_url = "https://config.myserver.com"
}Example configurations are provided in the examples directory. To use them:
- Configure your API credentials:
export TF_VAR_api_key="your-api-key"
export TF_VAR_api_secret="your-api-secret"- Navigate to the example directory:
cd examples/basic- Initialize Terraform:
terraform initterraform plan
terraform applyterraform showModify the configuration file, then:
terraform plan
terraform applyterraform destroyTo import existing CDN configurations:
terraform import multicdn_cdn_config.example [resource_id]To import existing preference settings:
terraform import multicdn_preference_config.example [resource_id]- Implement the feature in the
provider/directory - Add tests in the respective
*_test.gofiles - Run tests:
make test testacc