[!IMPORTANT]
Alpha release, don't use in production.
Code is contributed by an external entity and is currently undergoing review and testing - breaking changes might be introduced.
This Terraform provider implements (parts of) the qbee API, in order to facilitate configuration of
a qbee account using Terraform.
Using the provider
For documentation on how to use this provider, see the provider documentation
at the Terraform Registry.
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
.
Requirements
Building The Provider
- Clone the repository
- Enter the repository directory
- 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
.
Acceptance tests
In order to run the full suite of Acceptance tests, run make testacc
.
Note: Acceptance tests create real resources. They are dependent on valid qbee credentials being
configured in the environment (QBEE_USERNAME and QBEE_PASSWORD).
make testacc
If you want more control over what's run and output, you can do something like:
TF_LOG=INFO TF_ACC=1 go test -count=1 -run='TestAccTagFiledistributionGroupResource' -v ./internal/provider
Where:
TF_LOG
is the log level for Terraform
TF_ACC
is the flag to run acceptance tests
go test
is the command to run the tests
-count=1
is the flag to run the test only once
-run='TestAccTagFiledistributionGroupResource'
is the flag to run only the test with the given name
You can leave out the -run
flag to run all tests.
Installing the provider for local use
If you wish to use the provider locally, you can build it and place it in the correct directory.
# From the directory of terraform-provider-qbee
goreleaser build --single-target --clean
After this, the binary we built will be in ./dist/terraform-provider-qbee_OS_ARCH. Copy that to the
terraform project where you want to use it:
# From the root of your terraform project (where your *.tf files are stored):
GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
TARGET_DIR=".terraform/plugins/github.com/lesteenman/terraform-provider-qbee-lesteenman/$VERSION/${GOOS}_${GOARCH}"
mkdir -p "$TARGET_DIR"
cp <dist> "$TARGET_DIR"
After that, initialize the terraform project with terraform init -plugin-dir=.terraform/plugins
About
_This repository is built on the Terraform Plugin Framework template.