Overview
The Terraform provider for Xloud uses the OpenStack provider (hashicorp/openstack) to manage
compute, networking, storage, and identity resources. Infrastructure definitions are stored in
version-controlled .tf files, enabling repeatable deployments, drift detection, and change
review workflows via standard CI/CD tooling.
Prerequisites
- Terraform 1.3 or later installed (terraform.io)
- Xloud application credentials or an
openrcfile from the Dashboard - Network and security group resources created in your project (or managed via Terraform)
Provider Configuration
- Environment Variables
- Inline Configuration
Source your credentials file before running Terraform commands. The provider reads
standard
OS_* environment variables:Load Xloud credentials
provider.tf
Resource Examples
Compute Instance
compute.tf
Network and Router
networking.tf
Block Storage Volume
storage.tf
Floating IP
floating-ip.tf
State Management
- Remote State (Recommended)
- Local State
Store Terraform state remotely to enable collaboration and prevent state file conflicts.
Use an S3-compatible backend pointed at Xloud Object Storage:
backend.tf
Workflow
Initialize the working directory
Initialize Terraform
Review the execution plan
Show plan
Apply the configuration
Apply configuration
Resources are created and outputs are printed. Verify instances appear in the Dashboard under Project → Compute → Instances.
Next Steps
Ansible Integration
Combine Terraform provisioning with Ansible for post-provision configuration management
Auto-Scaling with Orchestration
Deploy auto-scaling stacks via Terraform and wire Prometheus alerts for dynamic scaling
Block Storage
Create and attach persistent volumes to Terraform-managed instances
Application Credentials
Generate non-expiring credentials for use in Terraform pipelines