This a Terraform provider for interacting with StatusPal API.
Visit statuspal.io.
- 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
.
See the statuspal Provider documentation.
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 .
from the root directory. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
In order to run the full suite of Acceptance tests, run TF_ENV=TEST TF_ACC=1 go test -v -cover ./internal/provider
from the root directory.
To test manually the resource or data source, run from the root directory:
- apply the terraform plan:
TF_ENV=DEV terraform -chdir=./examples/<resource_or_data_source_name> apply --auto-approve
- destroy the resource:
TF_ENV=DEV terraform -chdir=./examples/<resource_or_data_source_name> destroy --auto-approve
To generate or update documentation, run go generate ./...
from the root directory.
Note
For more information visit Implement a provider with the Terraform Plugin Framework:
- Skip the Docker part in Set up your development environment section and you have to run statuspal/statushq locally.
- In the Prepare Terraform for local provider install section, the
~/.terraformrc
file should look like this:provider_installation { dev_overrides { "registry.terraform.io/statuspal/statuspal" = "<PATH>" } # 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 {} }
- Add tests based on the Implement automated testing section.
- Don't forget to change the version number in the code and the documentation.
- Add the documentation based on the Implement documentation generation section.
- Run
golangci-lint run
and fix all the listed errors if there are any. - Add changes to CHANGELOG.md file.
- Follow the instructions in the Create a provider release section.