Skip to main content
The Control Plane Terraform provider lets you manage Control Plane resources as code using HashiCorp Configuration Language (HCL).

Terraform Registry

View the official Control Plane provider on the Terraform Registry for full documentation, resources, and data sources.

Setup

Add the Control Plane provider to your Terraform configuration:
terraform {
  required_providers {
    cpln = {
      source = "controlplane-com/cpln"
    }
  }
}

provider "cpln" {
  # Required
  # Can use CPLN_ORG Environment Variable
  org = var.org

  # Optional
  # Default Value: https://api.cpln.io
  # Can use CPLN_ENDPOINT Environment Variable
  endpoint = var.endpoint

  # Optional
  # Can use CPLN_PROFILE Environment Variable
  profile = var.profile

  # Optional
  # Can use CPLN_TOKEN Environment Variable
  token = var.token

  # Optional
  # Can use CPLN_REFRESH_TOKEN Environment Variable
  refresh_token = var.refresh_token
}
Then initialize your project:
terraform init
Requires Terraform 0.13+

Resources

Upgrading Provider Version

After installing a new provider version, follow these steps to upgrade an existing installation:
  1. Update the version property inside the HCL file that contains the required_providers declaration block for the cpln provider.
  2. Run the command: terraform init -upgrade to upgrade the Terraform dependencies (state file, etc.). The Terraform commands (plan, apply, etc.) will now use the latest version.
If necessary, the provider version can be downgraded.

Examples