Terraform Cilium Provider (Experimental)
The Cilium Provider allows Terraform to manage Cilium resources.
- Website: registry.terraform.io
Requirements
Building The Provider
$ git clone https://github.com/littlejo/terraform-provider-cilium.git
$ cd terraform-provider-cilium
Enter the provider directory and build the provider
$ make build
Using the provider
Please see the documentation in the Terraform registry.
Or you can browse the documentation within this repo here.
Using the locally built provider
If you wish to test the provider from the local version you just built, you can try the following method.
First install the Terraform Provider binary into your local plugin repository:
# Set your target environment (OS_architecture): linux_amd64, darwin_amd64...
$ vim GNUmakefile
$ make install
Then create a Terraform configuration using this exact provider:
$ mkdir ~/test-terraform-provider-cilium
$ cd ~/test-terraform-provider-cilium
$ cat > main.tf <<EOF
# Configure the cilium Provider
terraform {
required_providers {
cilium = {
source = "terraform.local/local/cilium"
version = "0.0.1"
}
}
}
provider "cilium" {
}
EOF
# Initialize your project and remove existing dependencies lock file
$ rm .terraform.lock.hcl && terraform init
...
# Apply your resources & datasources
$ terraform apply
...
Developing the Provider
If you wish to work on the provider, you'll first need Go installed on your machine (version 1.21+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin
to your $PATH
.
To compile the provider, run make build
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
$ make build
Testing the Provider
In order to test the provider, you can simply run make test
.
$ make test
In order to run the full suite of Acceptance tests you will need to create a kubernetes cluster like kind. You also can test on some examples:
- https://github.com/littlejo/terraform-kind-cilium
- https://github.com/littlejo/terraform-kind-cilium-clustermesh
Contributing
Please read the contributing guide to learn about how you can contribute to the Cilium Terraform provider.
There is no small contribution, don't hesitate!
Our awesome contributors: