Getting Started with Hashicorp Terraform Deployment
- Capella Operational
Use Terraform Provider to deploy and manage your clusters with declarative configuration.
The Capella Terraform Provider is a powerful way of programmatically managing Capella API keys, users, organizations, projects, clusters, buckets, and other resources. Although the Capella UI is a great way of trying out Couchbase, for ease of deployment an Infrastructure-as-Code (IaC) approach offers advantages in defining your Capella deployment in a human-readable file, for re-using, versioning, sharing across departments, and automating away repetitive admin tasks.
Before You Start
You will need the following to get going:
-
A recent version of Terraform — 1.5.2 or newer.
-
Go 1.2.1 or newer.
See the compatibility page for a list of supported architectures and Operating Systems.
Using the Capella Terraform Provider
For authentication with the Couchbase Capella Provider a V4 API key must be generated. This API key is then used for authenticating the Terraform Provider.
Full instructions to get up and running are given in the Capella Provider repo. The Provider can be downloaded from the Terraform Registry.
The list of supported resources and schema definitions are detailed in the Resources folder.
Example Usage
To get started, see the Provider Example Configs:
-
Retrieve organization details in Capella:
Couchbase Capella uses an ordered hierarchy to help you keep all of your data organized and securely accessible. The entity at the top of the hierarchy is called an organization. Everything you do in Capella — whether it’s creating a cluster or managing billing — happens within the scope of an organization.
-
Users have roles within an organization, and within individual projects.
-
Every API key is associated with an allowed IP Address list, and one or more organization roles, which determine the privileges that the API key has within the organization.
-
Within organizations, projects are used to organize and manage groups of Couchbase clusters. An organization can contain any number of projects, and a project can contain any number of clusters.
-
Create & manage Capella clusters (clusters):
The Cluster is the individual instance of a Couchbase Database, spanning one or more nodes on your Cloud Service Provider, and containing the Data Service, and any other services which you choose to deploy. Within this sits the hierarchy of bucket, scope, collection, and document.
-
Retrieve cluster certificate details:
Retrive the certificate details for a Capella cluster; list the certificate details based on the cluster ID and authentication access token.
-
Cluster credentials are separate from organization roles and project roles. A cluster credential is specific to a cluster and consists of a cluster access name, secret, and a set of bucket and scope access levels. It’s required for applications to remotely authenticate on a cluster and access bucket data.
-
More than one allowlist gives extra security across testing, development, and deployment infrastructure, and different projects.
-
The buckets is the top-level storage container for data in a Capella cluster.
-
Create and manage App Services in Capella.
-
Configure Bucket Backup & Restore:
Create and manage Backups in Capella.
Further Reading
-
Capella Terraform Provider repo — contains docs and examples