Provision resources with Terraform
Overview
The F5 Distributed Cloud Terraform provider (F5Networks/f5xc) lets you provision and manage Distributed Cloud resources as declarative infrastructure-as-code.
How to keep changes
When you run the terraform plan command, the provider checks your configuration and compares it with the current settings in Distributed Cloud. If someone changed a setting in Distributed Cloud Console, and you want to keep it, update your Terraform configuration to match. Run terraform plan again and review the proposed changes before applying them. The provider supports API token and certificate authentication. It can import supported resources that already exist in Distributed Cloud.
Legacy provider support
The legacy Volterra Terraform provider (volterraedge/volterra, resource prefix volterra_) remains supported in parallel for six months following the general availability of F5Networks/f5xc. It will continue to receive bug fixes and support for features shipped in major platform releases. After the six-month transition window, the legacy provider will be archived. New deployments must use F5Networks/f5xc. Existing deployments should plan their transition during this window.
Before you begin
Before you begin, make sure you have:
-
Terraform CLI version 1.11.0 or later.
-
A Distributed Cloud tenant URL (for example,
https://<tenant>.console.ves.volterra.io/api). -
A Distributed Cloud API token (recommended) or API certificate (
.p12bundle).
Install and configure the provider
- Declare
F5Networks/f5xcin yourrequired_providersblock and run theterraform initcommand to download the provider from the HashiCorp Terraform Registry.
terraform { required_providers { f5xc = { source = "F5Networks/f5xc" } }}
provider "f5xc" { url = "https://<tenant>.console.ves.volterra.io/api"}terraform init- Pass your API token using an environment variable so that credentials are never stored in version control.
export F5XCProvider_API_TOKEN="<your-api-token>"terraform planNote: You can also authenticate with an API certificate (
api_p12_file). Follow the provider's Authentication Guide for instructions.
Transition from the legacy provider (volterraedge/volterra)
When you transition from volterraedge/volterra to F5Networks/f5xc, you're adopting a new provider rather than upgrading the version of the legacy provider.
-
Update provider and resource blocks:
- Set the provider source to
F5Networks/f5xc. Update your resource and data source types to use thef5xcprefix in place ofvolterra_. Check the Registry documentation for each type you use. The new provider may also use a different name or format for a setting.
- Set the provider source to
-
Import existing live resources:
- Use
terraform importor animportblock to bring an existing, supported resource under Terraform management. For example, if your HTTP load balancer is named "web" and belongs to thepaymentsnamespace, usepayments/webas its import ID. Most resources use thisnamespace/nameformat. Some use only the namespace or only the name. Check theImportsection of your resource’s Registry page for the format it requires. For a step-by-step example, see Importing Existing Resources. Runterraform planand review any proposed changes before applying them.
- Use
-
Validate in a sandbox first:
- Test updated configurations and imports in a non-production namespace or tenant before switching production CI/CD pipelines.
Note: Certificate import limitation: Because the Distributed Cloud API redacts private keys in read responses for security, you can't directly import
f5xc_certificateresources. Create new certificates through Terraform so that Terraform manages the key from creation. Or, keep existing certificates managed in the Distributed Cloud Console or an external certificate manager. Reference them by name and namespace on imported load balancers.
References
For the current provider (F5Networks/f5xc), see the following:
- Terraform Registry Documentation (F5Networks/f5xc)
- GitHub Repository and Releases (F5Networks/terraform-provider-f5xc)
For the legacy provider (volterraedge/volterra), see the following:
- Legacy Terraform Registry Documentation (volterraedge/volterra)
- Legacy GitHub Repository and Releases (volterraedge/terraform-provider-volterra)
Get support
GitHub Issues and Pull Requests are disabled and not monitored on Distributed Cloud Terraform repositories. To report a defect or request technical assistance for either supported provider, open a support case in the Distributed Cloud Console:
- Select Support > Contact Support.
- Select Workspace: Automation.
- Select Type: Technical Support.
- Select Topic: Terraform Provider.
- Select your Priority.
- In the Subject field, enter a short description.
- In the Product Data box, enter a detailed description.
- Optionally, select your Timezone.
- Select Submit Request.