Skip to content

Constellix/terraform-provider-constellix-multicdn

Constellix MultiCDN Terraform Provider

This Terraform provider allows for the management of MultiCDN configurations through Terraform. It currently supports two resource types:

  • CDN Configuration Resources
  • Preference Resources

Requirements

  • Terraform >= 1.0
  • Go >= 1.24.5 (for development/building from source)

Building The Provider

Building

Clone the repository and build the provider:

git clone <repository-url>
cd terraform-provider-constellix-multicdn
make build

Installing

To install the provider for local development:

make install

This will build and install the provider to ~/.terraform.d/plugins/registry.terraform.io/constellix/constellix-multicdn/0.0.1/darwin_arm64/.

Testing

Run the unit tests:

make test

Run the acceptance tests (requires API access):

make testacc

Provider Configuration

The 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"
}

Usage

Example Files

Example configurations are provided in the examples directory. To use them:

  1. Configure your API credentials:
export TF_VAR_api_key="your-api-key"
export TF_VAR_api_secret="your-api-secret"
  1. Navigate to the example directory:
cd examples/basic
  1. Initialize Terraform:
terraform init

CRUD Operations

Create Resources

terraform plan
terraform apply

Read Resource Information

terraform show

Update Resources

Modify the configuration file, then:

terraform plan
terraform apply

Delete Resources

terraform destroy

Import Existing Resources

To 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]

Development

Adding New Features

  1. Implement the feature in the provider/ directory
  2. Add tests in the respective *_test.go files
  3. Run tests: make test testacc

About

The terraform provider for the multicdn configuration and preference within the constellix platform.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors