WGC bexio provider is a custom terraform provider to interact with Bexio resources.
Right now only "Contacts" and "Fictional Users" maybe generated.
With this provider you can interact with the Bexio API. You can search for users via their email address, and you can read all users from your Organisation. This provider helps you create a contact or fictional user on bexio without going through the create new user wizard on the bexio website. As basis for our code we used Go and terraform. Very good help is the following tutorial Perform CRUD Operations with Providers.
Project is created with:
- terraform version: v1.2.2
- Go version: go1.18.3
- hashicorps terraform-plugin-sdk version: v2 Imported packages:
- github.com/hashicorp/terraform-plugin-sdk/v2/diag
- github.com/hashicorp/terraform-plugin-sdk/v2/helper
- Customize the Makefile according to your OS Architecture
- Delete the go.mod file
-
$ go mod init wgc_bexio_provider $ go mod tidy $ make install
Type these three commands in a terminal in your Project folder. → this will build the provider and moves it to a location where it can be used by terraform.
- Test the provider by executing
$ terraform init
→ this will initialize the provider for terraform, then to Test it run the following command$ terraform plan
and to apply it run$ terraform apply
. If everything worked as expected delete the resource with the command$ terraform destroy
.
Run all Tests via:
make testacc TEST=./bexioprovider
or a single test with:
make testacc TEST=./bexioprovider TESTARGS="-run=TestAccUpdateFictionalUser"
For a tutorial/documentation of the provider go to [Bexio Hashicorp](inset link for hashicorp site where docu iss)
Please read the CONTRIBUTION-File