In this repo, you'll find the source code for the Border0 Terraform Provider. With this provider, you can provision and manage Border0 resources, such as sockets, policies, and connectors, using Terraform.
Copy the following code to your terraform config and run terraform init:
terraform {
required_providers {
border0 = {
source = "borderzero/border0"
}
}
}
provider "border0" {
// Border0 token. Required.
// If not set explicitly, the provider will use the env var BORDER0_TOKEN.
//
// You can generate a Border0 token by going to:
// portal.border0.com -> Team -> Service Accounts
// and creating a service account and a token.
token = "_my_service_account_token_"
}And explore the examples folder for additional use cases and examples. For a comprehensive step-by-step guide, check out our Quickstart Guide on docs.border0.com.
To (re)generate docs, install tfplugindocs first:
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latestAnd then run:
make docsMake the changes you'd like!
Then, navigate to the examples/development directory:
cd examples/developmentInstall a border0 terraform provider (which includes your local changes):
make initLog in to border0
make tokenApply the development setup:
make applyDestroy the development setup:
make destroyInstall goreleaser:
brew install goreleaserRun local release command and build terraform provider binaries
make releaseYou will find the releases in the /dist directory. You will need to rename the provider binary to terraform-provider-border0 and move the binary into
the appropriate subdirectory within the user plugins directory.
Configuration examples can be tested with a local build of this terraform provider.
First, build and install the provider.
make installThen, navigate to the examples directory.
cd examplesRun the following command to initialize the workspace and apply the sample configuration.
terraform init && terraform applySome different variations:
# run against prod api
BORDER0_TOKEN=_border0_auth_token_ terraform apply
# run with a local dev api that's listening to localhost:8080
BORDER0_TOKEN=_border0_auth_token_ BORDER0_API=http://localhost:8080/api/v1 terraform applyCreate a new tag. Assuming the next release is v1.1.1.
git tag v1.1.1Push the tag to GitHub.
git push origin v1.1.1It will trigger the GitHub Actions release workflow.