CloudNexus Terraform Provider
Provision and manage CloudNexus infrastructure using declarative Terraform configurations. Fully supported by the CloudNexus engineering team.
Installation #
Add the CloudNexus provider to your Terraform configuration using the official registry package.
main.tf
terraform {
required_version = ">= 1.0.0"
required_providers {
cloudnexus = {
source = "cloudnexus/cloudnexus"
version = "~> 1.2"
}
}
}
Initialize the provider with terraform init. The plugin will be automatically downloaded from the CloudNexus registry.
Terminal
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding cloudnexus/cloudnexus versions matching "~> 1.2"...
- Installing cloudnexus/cloudnexus v1.2.0...
Terraform has been successfully initialized!
Configuration #
The provider accepts the following configuration arguments:
| Argument | Description | Type |
|---|---|---|
api_key REQUIRED |
Your CloudNexus API access key. Can also be set via CNX_API_KEY |
string |
region |
Default region for resource creation. Falls back to CNX_REGION |
string |
endpoint |
Custom API endpoint for self-hosted or enterprise deployments | string |
project_id |
Explicitly set the project/organization scope | string |
provider.tf
provider "cloudnexus" {
api_key = "cnx_live_sk_8f3a2b..."
region = "us-east-1"
project = "prod-infrastructure"
}
Authentication #
Security Note: Never commit API keys directly into version control. Use environment variables, HashiCorp Vault, or GitHub Secrets.
CloudNexus supports multiple authentication methods, evaluated in the following order:
api_keyin the provider blockCNX_API_KEYenvironment variable~/.cloudnexus/credentialsconfig file- OIDC/GitHub Actions automatic injection (CI/CD)
Environment Setup
# Set in your shell or CI/CD pipeline
export CNX_API_KEY="cnx_live_sk_..."
export CNX_REGION="eu-west-2"
export CNX_PROJECT="acme-corp"
Example Usage #
Deploy a managed Kubernetes cluster with auto-scaling and attached networking:
k8s-deploy.tf
resource "cloudnexus_kubernetes_cluster" "main" {
name = "production-api"
region = "us-east-1"
kubernetes_version = "1.28"
node_pool {
name = "workers"
machine_type = "cnx-c4.2xlarge"
min_nodes = 2
max_nodes = 10
auto_upgrade = true
disk_size_gb = 100
}
network {
enable_private_nodes = true
master_ipv4_cidr_block = "10.0.0.0/28"
}
tags = {
Environment = "Production"
Team = "Platform"
}
}
Version Compatibility #
| Provider Version | Terraform | Status | Notes |
|---|---|---|---|
~> 1.2 |
=> 1.0 |
β Supported | Current stable release |
~> 1.0 - 1.1 |
=> 0.15 |
β οΈ Maintenance | Security patches only |
< 1.0 |
=> 0.12 |
β Deprecated | Archived, unsupported |
Community & Support #
Get help, report issues, or contribute to the provider:
- π Bug Reports: GitHub Issues (cloudnexus/terraform-provider)
- π¬ Community: Discord #terraform channel
- π Contributing: See
CONTRIBUTING.mdfor development setup - π Enterprise Support: Available for Business & Enterprise plans