Civo Provider
Installation
The civo provider is available as a package in all Pulumi languages:
- JavaScript/TypeScript:
@pulumi/civo
- Python:
pulumi-civo
- Go:
github.com/pulumi/pulumi-civo/sdk/v2/go/civo
- .NET:
Pulumi.Civo
- Java:
com.pulumi/civo
Overview
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.
Configuration
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
credentialsFile
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 credentialsFile
is set, that will be used over the CLI credentials.
Obtaining a token
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
Using the CIVO_TOKEN variable
To use the Civo token, export the variable containing your token:
export CIVO_TOKEN=<your token>
Using a credentials file
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 credentialsFile
input to the correct location, for example:
credentialsFile = "/secure/path/civo.json"
Using the CLI
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.
Example Usage
Simplest 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.
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: nodejs
config:
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: python
config:
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: dotnet
config:
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: go
config:
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: yaml
config:
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: java
config:
civo:region:
value: LON1
Example with credentials file
In this example we are providing a specific version of the pulumi provider and setting a credentials file to use. The credentials file will be used if the environment variable CIVO_TOKEN
is not set.
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: nodejs
config:
civo:credentialsFile:
value: /secure/path/civo.json
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: python
config:
civo:credentialsFile:
value: /secure/path/civo.json
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: dotnet
config:
civo:credentialsFile:
value: /secure/path/civo.json
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: go
config:
civo:credentialsFile:
value: /secure/path/civo.json
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: yaml
config:
civo:credentialsFile:
value: /secure/path/civo.json
civo:region:
value: LON1
# Pulumi.yaml provider configuration file
name: configuration-example
runtime: java
config:
civo:credentialsFile:
value: /secure/path/civo.json
civo:region:
value: LON1
Configuration Reference
apiEndpoint
(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.credentialsFile
(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 pulumi state we have deprecated this and will be remove in future versions - don’t use it.