Terraform/OpenTofu provider for managing Verda Cloud infrastructure.
- Terraform >= 1.0
- Go >= 1.23 (for development)
- Verda Cloud account with API credentials (Client ID and Client Secret)
This software is currently in beta and will contain bugs. Please try it out and report your issues in the repository.
As the provider is not yet in the Terraform registry, the local version needs to be referred in your .terraformrc file:
provider_installation {
dev_overrides {
"verda-cloud/verda" = "/path/to/binary/terraform-provider-verda"
}
direct {}
}The binary can be downloaded to your machine from the Releases page. Usage instructions and examples can be found from the examples directory.
To use this provider, add it to your Terraform configuration:
terraform {
required_providers {
verda = {
source = "verda-cloud/verda"
}
}
}
provider "verda" {
client_id = var.verda_client_id
client_secret = var.verda_client_secret
# base_url = "https://api.verda.com/v1" # Optional, defaults to this value
}The provider supports the following methods for providing credentials:
- Provider Configuration (shown above)
- Environment Variables:
VERDA_CLIENT_IDVERDA_CLIENT_SECRETVERDA_BASE_URL(optional)
The provider currently supports the following resources:
Manages SSH keys for accessing Verda instances.
resource "verda_ssh_key" "example" {
name = "my-ssh-key"
public_key = file("~/.ssh/id_rsa.pub")
}Manages startup scripts that can be executed when instances are created.
resource "verda_startup_script" "example" {
name = "setup-script"
script = <<-EOF
#!/bin/bash
apt-get update
apt-get install -y docker.io
EOF
}Manages storage volumes.
resource "verda_volume" "example" {
name = "terraform-test-volume"
size = 100 # Size in GB
type = "NVMe"
location = "FIN-01"
}Manages compute instances.
resource "verda_instance" "example" {
instance_type = "small"
image = "ubuntu-22.04"
hostname = "my-instance"
description = "Example instance"
location = "FIN-01"
ssh_key_ids = [verda_ssh_key.example.id]
startup_script_id = verda_startup_script.example.id
# Optional: Create new volumes
volumes = [
{
name = "terraform-data-volume"
size = 500
type = "NVMe"
}
]
# Optional: Attach existing volumes
existing_volumes = [verda_volume.example.id]
}To build the provider from source:
git clone https://github.com/verda-cloud/terraform-provider-verda
cd terraform-provider-verda
go buildTo test the provider locally, you can use Terraform's development overrides. Create a .terraformrc file in your home directory:
provider_installation {
dev_overrides {
"verda-cloud/verda" = "/path/to/terraform-provider-verda"
}
direct {}
}Then build the provider and use it in your Terraform configurations.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions:
- GitHub Issues: https://github.com/verda-cloud/terraform-provider-verda/issues
- Verda Cloud Documentation: https://docs.verda.com