This is the repository for Couchbase's Terraform-Provider-Capella which forms a Terraform plugin for use with Couchbase Capella.
- We use Go Modules to manage dependencies, so you can develop outside your
$GOPATH. - We use golangci-lint to lint our code, you can install it locally via
make setup.
To use a released provider in your Terraform environment, run terraform init and Terraform will automatically install the provider.
Documentation about the provider specific configuration options can be found on the provider's website.
See Contributing.md
Most of the new features of the provider are using capella-public-apis Public APIs are updated automatically, tracking all new Capella features.
This repository includes an OpenAPI-generated client in internal/generated/api (keeping the existing hand-written client in internal/api for backward compatibility).
Generate/update the client before working on a new resource or data source:
-
Ensure the generator is installed:
go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest -
Regenerate from the root
openapi.generated.yaml:make gen-api
The command writes the client/types to internal/generated/api/openapi.gen.go.
Notes:
- Provider wiring makes both clients available:
providerschema.Data.ClientV1: legacy HTTP client (internal/api)providerschema.Data.ClientV2: generated client with typed methods (internal/generated/api)
- When adding a new resource/data source, prefer calling
ClientV2for new endpoints and migrate incrementally.