Giter Site home page Giter Site logo

gustavotero7 / terraform-provider-cockroachdb Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 191 KB

CockroachDB terraform provider with support for databases, grants (+ grant role) and roles.

Home Page: https://registry.terraform.io/providers/gustavotero7/cockroachdb/latest/docs

License: Mozilla Public License 2.0

Makefile 0.41% Go 99.59%
cockroachdb terraform

terraform-provider-cockroachdb's Introduction

Terraform Provider CockroachDB (Terraform Plugin SDK)

CockroachDB terraform provider with support for databases, grants (+ grant role) and roles.

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

  1. Init the provider
provider "cockroachdb" {
  host     = "remote_host"
  port     = 26257
  username = "test_user"
  password = "a1s2d3f4g5h6j7k8l9"
  database = "test_database"
  cluster  = "test_cluster_123"
}
  1. Create resources
resource "cockroachdb_database" "test_database" {
  name = "test_database"
}

resource "cockroachdb_role" "test_role" {
  name = "test_role"
}

resource "cockroachdb_grant" "test_role_grant" {
  role        = cockroachdb_role.test_role.name
  object_type = "table"
  objects     = [cockroachdb_database.test_database.public.*]
  privileges  = ["SELECT", "UPDATE"]
  force_recreate = true
}

See more examples in the examples folder

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.

To generate or update documentation, run go generate.

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create real resources, and often cost money to run.

$ export TEST_COCKROACHDB_HOST={your_db_host}
$ export TEST_COCKROACHDB_PORT={your_db_port}
$ export TEST_COCKROACHDB_USERNAME={your_db_username}
$ export TEST_COCKROACHDB_PASSWORD={your_db_password}
$ export TEST_COCKROACHDB_DATABASE={your_db_database}
$ export TEST_COCKROACHDB_CLUSTER={your_db_cluster}
$ make testacc

terraform-provider-cockroachdb's People

Contributors

gustavotero7 avatar dependabot[bot] avatar

Stargazers

 avatar Entrapta Jones avatar Andrew Hubler avatar Yuri Olive avatar

Watchers

James Cloos avatar  avatar

Forkers

authorityorg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.