The Clever Cloud Provider allows Terraform to manage Clever Cloud resources.
- Go 1.23.7 or later
- golangci-lint for code linting
- tfplugindocs for documentation generation
To use this provider, you need to configure your Clever Cloud credentials. You can obtain these from your Clever Cloud console or clever-tools.
Set the following environment variables:
export CLEVER_TOKEN="your-clever-cloud-token"
export CLEVER_SECRET="your-clever-cloud-secret"
export ORGANISATION="your-organization-id" # Optional, for multi-org accountsRun the following command to build the provider
$ go build -o terraform-provider-clevercloudRun the following command to build and install the provider in the current user's terraform plugin directory
$ makeTo produce an unstripped binary (for debugging purpose), override LDFLAGS with an empty value:
$ make LDFLAGS=""The examples directory contains sample Terraform configurations demonstrating how to use the provider:
- Basic usage (
main.tf): Shows how to create PostgreSQL databases, Node.js applications, and Cellar storage - Individual resources (
resources/): Detailed examples for specific resource types
To test the examples:
-
Build and install the provider:
make install
-
Navigate to the examples directory:
cd examples -
Set required variables:
export TF_VAR_organisation="your-org-id"
-
Initialize and apply:
terraform init && terraform apply
First, build and install the provider:
$ make installThen, create or modify the file ~/.terraformrc with the following configuration:
provider_installation {
dev_overrides {
"CleverCloud/clevercloud" = "/home/[USER]/.terraform.d/plugins/registry.terraform.io/CleverCloud/clevercloud/dev/linux_amd64"
}
direct{}
}Full documentation for all resources and data sources is available in the /docs directory. The documentation is automatically generated from the provider schema and includes:
- Provider configuration
- Resource documentation for all supported services (Docker, Node.js, PostgreSQL, etc.)
- Usage examples and configuration options
To regenerate the documentation after making changes:
make docs