The Ziti Terraform Provider allows you to manage and configure Ziti network as code using Terraform.
Configuring required providers:
terraform {
required_providers {
ziti = {
source = "netfoundry/ziti"
}
}
}
The Ziti provider offers different ways of providing credentials for authentication. The following methods are supported:
- Static credentials
- Environment variables
Default static credentials can be provided by adding the username
, password
and host
:
provider "ziti" {
username = "zitiuser"
password = "zitipassword"
host = ["https://localhost:443/edge/management/v1"]
}
You can provide your credentials for the default connection via the ZITI_API_USERNAME
, ZITI_API_PASSWORD
and ZITI_API_HOST
,
environment variables, representing your user, password and domain/host respectively.
provider "ziti" {
}
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements).
For local plugin development see Local Plugin Development before building the provider.
To compile the provider, run go install
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
- 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
Add the below snippet at ~/.terraformrc on your machine.
provider_installation {
dev_overrides {
# point to local go path for compiled binaries
"netfoundry/ziti" = "/path/to/go/bin"
}
# 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 {}
}