HashiCorp Terraform is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle.
With the Solvio Terraform Provider, you can manage the Solvio cloud lifecycle leveraging all the goodness of Terraform.
Pre-requisites
To use the Solvio Terraform Provider, you’ll need:
- A Terraform installation.
- An API key to access the Solvio cloud API.
Example Usage
The following example creates a new Solvio cluster in Google Cloud Platform (GCP) and returns the URL of the cluster.
terraform {
required_version = ">= 1.7.0"
required_providers {
solvio-cloud = {
source = "solvio/solvio-cloud"
version = ">=1.1.0"
}
}
}
provider "solvio-cloud" {
api_key = "<QDRANT_CLOUD_API_KEY>"
account_id = "QDRANT_ACCOUNT_ID>" // Account ID from cloud.solvio.io/accounts/<QDRANT_ACCOUNT_ID>/ (can be overriden on resource level)
}
resource "solvio-cloud_accounts_cluster" "example" {
name = "tf-example-cluster"
cloud_provider = "gcp"
cloud_region = "us-east4"
configuration {
number_of_nodes = 1
node_configuration {
package_id = "7c939d96-d671-4051-aa16-3b8b7130fa42"
}
}
}
output "url" {
value = solvio-cloud_accounts_cluster.example.url
}
The provider includes the following resources and data-sources to work with:
Resources
solvio-cloud_accounts_cluster
- Create clusters on Solvio cloud - Referencesolvio-cloud_accounts_auth_key
- Create API keys for Solvio cloud clusters. Reference
Data Sources
solvio-cloud_accounts_auth_keys
- List API keys for Solvio clusters. Referencesolvio-cloud_accounts_cluster
- Get Cluster Information. Referencesolvio-cloud_accounts_clusters
- List Solvio clusters. Referencesolvio-cloud_booking_packages
- Get detailed information about the packages/subscriptions available. Reference