The DanubeData Terraform provider allows you to manage DanubeData infrastructure resources using Terraform.
Requirements
- Terraform >= 1.0
- Go >= 1.21 (for building from source)
- A DanubeData account and API token
Installation
terraform {
required_providers {
danubedata = {
source = "AdrianSilaghi/danubedata"
version = "~> 0.3"
}
}
}
Building from Source
git clone https://github.com/AdrianSilaghi/terraform-provider-danubedata.git
cd terraform-provider-danubedata
make install
Authentication
The provider requires an API token for authentication. You can provide it in several ways:
Environment Variable (Recommended)
export DANUBEDATA_API_TOKEN="your-api-token"
Provider Configuration
provider "danubedata" {
api_token = "your-api-token" # Not recommended for production
}
Quick Start
terraform {
required_providers {
danubedata = {
source = "AdrianSilaghi/danubedata"
version = "~> 0.3"
}
}
}
provider "danubedata" {}
# Create an SSH key
resource "danubedata_ssh_key" "example" {
name = "my-ssh-key"
public_key = file("~/.ssh/id_ed25519.pub")
}
# Create a VPS instance
resource "danubedata_vps" "example" {
name = "my-server"
image = "ubuntu-22.04"
datacenter = "fsn1"
auth_method = "ssh_key"
ssh_key_id = danubedata_ssh_key.example.id
# Optional: pick a plan. CPU, memory and storage follow from it and are
# read-only; setting them directly fails at plan time.
resource_profile = "micro_shared"
}
output "server_ip" {
value = danubedata_vps.example.public_ip
}
Resources
Data Sources
Examples
See the examples directory for complete configuration examples:
Development
Prerequisites
- Go 1.21+
- Terraform 1.0+
- Make
Building
# Build the provider
make build
# Install to local Terraform plugins directory
make install
# Run tests
make test
# Run acceptance tests (requires API token)
make testacc
Running Acceptance Tests
Acceptance tests create real resources and may incur charges. Use a test account.
export DANUBEDATA_API_TOKEN="your-test-token"
make testacc
Documentation
The pages under docs/ are maintained by hand — there are no tfplugindocs
templates and no //go:generate directives behind them. Edit the relevant
Markdown file directly and keep it in step with the provider schema; running a
generator over docs/ would discard the hand-written content.
To check a schema claim against the current build:
go build -o /tmp/terraform-provider-danubedata .
terraform providers schema -json | jq .
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
This provider is licensed under the Mozilla Public License 2.0. See LICENSE for details.