Skip to content

Latest commit

 

History

History
82 lines (54 loc) · 2.53 KB

README.md

File metadata and controls

82 lines (54 loc) · 2.53 KB

Terraform Provider for SUSE NeuVector

The Terraform NeuVector provider is a plugin that allows Terraform to manage the installation and maintenance of SUSE NeuVector on any Kubernetes cluster.

Terraform useful links

SUSE NeuVector useful links

Requirements

To find out which version of the tools above was used to build the provider in the repository, look at this file.

Develop the provider (macOS example)

Download the repository locally

git clone [email protected]:<YOUR-GITHUB-USERNAME>/terraform-provider-neuvector.git
cd terraform-provider-neuvector

Make your changes

Edit the main.go file to point to your repository

sed -i '' "[email protected]/glovecchi0/terraform-provider-neuvector/[email protected]/<YOUR-GITHUB-USERNAME>/terraform-provider-neuvector/neuvector@g" main.go

Configure the correct environment variables

export GOPRIVATE=github.com/<YOUR-GITHUB-USERNAME>
export GIT_TERMINAL_PROMPT=1
export GITHUB_TOKEN=<YOUR-PERSONAL-ACCESS-TOKEN>

Build the provider

go mod init github.com/<YOUR-GITHUB-USERNAME>/terraform-provider-neuvector
go mod tidy
go build -o terraform-provider-neuvector_v<VERSION>

Test the provider (locally)

Make sure you are inside the repository

$ pwd
  ~/terraform-provider-neuvector

Copy the provider to the local path ~/.terraform.d/plugins/

mkdir -p ~/.terraform.d/plugins/registry.terraform.io/local/neuvector/<VERSION>/darwin_arm64
cp terraform-provider-neuvector_v<VERSION> ~/.terraform.d/plugins/registry.terraform.io/local/neuvector/<VERSION>/darwin_arm64/
chmod +x ~/.terraform.d/plugins/registry.terraform.io/local/neuvector/<VERSION>/darwin_arm64/terraform-provider-neuvector_v<VERSION>

Run the sample Terraform files

cd tf-projects/example/