Use the Tharsis Provider to interact with Tharsis 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 this provider you must add the provider definition to your configuration. You can use either a static token or service account for authentication.
To use static tokens you can define your provider block as follows:
provider "tharsis" {
host = "https://tharsis.example.com"
static_token = "my-static-token"
}
For a service account it would look like this:
provider "tharsis" {
host = "https://tharsis.example.com"
service_account_path = "my-service_account-path"
service_account_token = "my-service-account-token"
}
Alternatively, you can provide these values by environment variables.
Environment Variable | Definition |
---|---|
THARSIS_ENDPOINT |
The host for Tharsis. |
THARSIS_STATIC_TOKEN |
The static token to use with the provider. |
THARSIS_SERVICE_ACCOUNT_PATH |
The service account's full path to use with the provider. |
THARSIS_SERVICE_ACCOUNT_TOKEN |
The service account token to use with the provider. |
The provider block values take precedence over environment variables. It is recommended to use configuration values to define the provider over environment variables, especially if you are defining the provider more than once.
In the case both static and service account credentials are passed, service account credentials take precedence.
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.
make testacc
If you've discovered a security vulnerability in the Terraform Tharsis Provider, please create a new issue in this project and ask for a preferred security contact so we can setup a private means of communication (the issue should NOT include any information related to the security vulnerability).
Please submit any bugs or feature requests for Tharsis. Of course, MR's are even better. :)
Terraform Tharsis Provider is distributed under Mozilla Public License v2.0.