This provider plugin allows to configure the access control for Scylladb through Terraform, including roles, keyspaces, and grants. It contains the following
internal/provider/: A resource and a data sourceexamples/: examplesdocs/: generated documentation,scylladb/: client for scylladb and abstracted methods to update ACL in scylladb
- Clone the repository to
$GOPATH/src/github.com/hashicorp/terraform-provider-scylladb - Enter the repository directory
- Build the provider using the Go
installcommand:
go installIf 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 make generate.
In order to run the full suite of Acceptance tests, run make testacc.
Note: Acceptance tests create real resources and scylladb containers, and it would run slower than typical unittests.
make testaccThe following is a general guidance on how to use the local provider you are developing in terraform code before it is published.
-
Using
dev_overridespathFollow the official direction, here. This allows to use the provider by running
go install .. Your~/.terraformrcwould look likeprovider_installation { dev_overrides { "registry.terraform.io/retailnext/scylladb" = "/Users/myusername/go/bin" } # For all other providers, install them directly from their origin provider # registries as normal. If you omit this, Terraform will _only_ use # the dev_overrides block, and so no other providers will be available. direct {} }Please note that after
dev_overridesis added, you cannot runterraform initifregistry.terraform.io/retailnext/scylladbappears in the terraform code. That means, if you have other non-local providers in your terraform code, you will not be able to runterraform init. In this case, use the following "release" binary method.If you are using
tofu, update~/.tofurcand useregistry.opentofu.orgas the provider registry. -
Using the local "release" binary
By manually doing the steps which
terraform initwould have, you can use the local code. The following example shows the steps in a linux environment with amd64 processor.CGO_ENABLED=0 go build -trimpath -o terraform-provider-scylladb_v1.0.0 -ldflags "-s -w -X main.version=1.0.0" . mkdir -p ~/.terraform.d/plugins/local.providers/local/scylladb/1.0.0/linux_amd64 mv terraform-provider-scylladb_v1.0.0 ~/.terraform.d/plugins/local.providers/local/scylladb/1.0.0/linux_amd64 cat <<EOF > $HOME/.terraformrc provider_installation { filesystem_mirror { path = "/home/runner/.terraform.d/plugins" include = ["local.providers/*/*"] } direct { exclude = ["local.providers/*/*"] } } EOFIf you are using
tofu, use$HOME/.tofurcinstead of$HOME/.terraformrcin the example.