The Timeplus provider for Terraform is a plugin that enables full lifecycle management of Timeplus resources.
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
install
command:
go install
This provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.
To add a new dependency github.com/author/dependency
to your Terraform provider:
go get github.com/author/dependency
go mod tidy
Then commit the changes to go.mod
and go.sum
.
To use the provider, simply add it to your terraform file, for example:
terraform {
required_providers {
timeplus = {
source = "timeplus-io/timeplus"
version = ">= 0.1.2"
}
}
}
provider "timeplus" {
# the workspace ID can be found in the URL https://us.timeplus.cloud/<my-workspace-id>
workspace = "my-workspace-id"
# API key is required to use the provider
api_key = "my-api-key"
}
Then you can start provisioning Timeplus resources, and below is an example of stream:
resource "timeplus_stream" "example" {
name = "example"
description = "the example stream from the provider README file"
column {
name = "col_1"
type = "string"
}
column {
name = "col_2"
type = "int64"
}
}
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
To compile the provider, run go install
. This will build the provider and put the provider binary in the $GOPATH/bin
directory. Please follow Prepare Terraform for local provider install to use the locally-built provider to test it.
To generate or update documentation, run go generate
.
- Timeplus document web site: https://docs.timeplus.com/
- Terraform plugin framework doc: https://developer.hashicorp.com/terraform/plugin/framework