/terraform-provider-timeplus

Terraform provider for Timeplus.

Primary LanguageGoMozilla Public License 2.0MPL-2.0

Terraform logo

Timeplus Provider for Terraform

The Timeplus provider for Terraform is a plugin that enables full lifecycle management of Timeplus resources.

Requirements

Building The Provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Go install command:
go install

Adding Dependencies

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.

Using the provider

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"
    }
}

Developing the Provider

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.

Useful documentations for provider development