Skip to content

CleverCloud/terraform-provider-clevercloud

Repository files navigation

Terraform Clever Cloud Provider

The Clever Cloud Provider allows Terraform to manage Clever Cloud resources.

Prerequisites

Authentication

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 accounts

Build provider

Run the following command to build the provider

$ go build -o terraform-provider-clevercloud

Examples

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:

  1. Build and install the provider:

    make install
  2. Navigate to the examples directory:

    cd examples
  3. Set required variables:

    export TF_VAR_organisation="your-org-id"
  4. Initialize and apply:

    terraform init && terraform apply

Testing dev build

First, build and install the provider:

$ make install

Then, 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{}
}

Documentation

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

Contributors 10

Languages