The Ghost Security terraform provider.
Terraform Registry: ghostsecurity/ghost
Refer to the Hashicorp Documentation for more details on developing custom providers.
- Terraform >= 1.0
- Go >= 1.23
- golangci-lint >= 1.61
To build and install the provider locally run make install.
To configure terraform to use the locally installed provider instead of the terraform registry, edit the ~/.terraformrc file as follows:
provider_installation {
dev_overrides {
"ghostsecurity/ghost" = "<PATH>"
}
direct {}
}The value for <PATH> should be GOBIN path where Go installs binaries. This will either be the value returned from go env GOBIN or the default path of $HOME/go/bin if empty.
With the terraform provider installed locally you should be abled to use it by specifying the source in the required_providers block to match what was specified in the dev_overrides block of your ~/.terraformrc.
Example main.tf:
terraform {
required_providers {
ghost = {
source = "ghostsecurity/ghost",
}
}
}
provider "ghost" {
}
resource "ghost_log_forwarder" "example" {
name = "example"
}
output "subject_id" {
value = ghost_log_forwarder.example.subject_id
}Tag a new release version using the GitHub releases and the release workflow will run to build the new provider version for all the supported platforms. Release version tag must be a semantic version starting with v (for example v0.7.2).
To run the acceptance tests you must first set a valid GHOST_API_KEY in the environment.
Running make test-acc will run the acceptance tests to exercise the various terraform
resources using the actual API which will create/destroy real resources in the platform.