layout | page_title | description |
---|---|---|
Provider: Civo |
The Civo provider is used to interact with the resources supported by Civo. The provider needs to be configured with the proper credentials before it can be used. |
The Civo provider is used to interact with the resources supported by Civo.
Use the navigation to the left to read about the available resources.
The provider will use the credentials of the Civo CLI (stored in ~/.civo.json
) if no other credentials have been set up. The provider will use credentials in the following order:
- Environment variable (
CIVO_TOKEN
). - Token provided via a credentials file (See
credentials_file
input below) - CLI configuration (
~/.civo.json
)
That means that if the CIVO_TOKEN
variable is set, all other credentials will be ignored, and if the credentials_file
is set, that will be used over the CLI credentials.
First you will need to create a Civo Account and then you can do the following:
- If you can want to configure your credentials with the CLI, instructions are here
- To fetch an API key go to the security section on the dashboard
To use the Civo token, export the variable containing your token:
export CIVO_TOKEN=<your token>
The format of the credentials file is as follows:
{
"apikeys": {
"tf_key": "write-your-token-here"
},
"meta": {
"current_apikey": "tf_key"
}
}
you will then need to configure the credentials_file
input to the correct location, for example:
credentials_file = "/secure/path/civo.json"
If you install the CLI and configure a token, there is nothing else you need to do if those are the credentials you wish to use, ideal for local usage.
In this example the provider will look for credentials set by the CLI and use LON1 region as default, or use the environment variable CIVO_TOKEN
if set.
terraform {
required_providers {
civo = {
source = "civo/civo"
}
}
}
provider "civo" {
region = "LON1"
}
In this example we are providing a specific version of the terraform provider and setting a credentials file to use. The credentials file will be used if the environment variable CIVO_TOKEN
is not set.
terraform {
required_providers {
civo = {
source = "civo/civo"
version = "1.1.0"
}
}
}
provider "civo" {
credentials_file = "/secure/path/civo.json"
region = "LON1"
}
api_endpoint
(String) The Base URL to use for CIVO API.region
(String) This sets the default region for all resources. If no default region is set, you will need to specify individually in every resource.credentials_file
(string) specify a location for a file containing your civo credentials tokentoken
(String) (Deprecated) for legacy reasons the user can still specify the token as an input, but in order to avoid storing that in terraform state we have deprecated this and will be remove in future versions - don't use it.