The Facets Terraform Provider allows you to manage Tekton-based Kubernetes workflows integrated with the Facets platform.
- π Automated Credential Management - Kubernetes credentials are automatically injected based on user RBAC
- π§ Simple Configuration - Define workflows using familiar Terraform syntax
- π― Tekton Integration - Creates Tekton Tasks and StepActions automatically
- π Blueprint Mapping - Seamlessly maps to Facets blueprint resources
- π RBAC-Scoped - User permissions enforced automatically
- In-cluster Kubernetes authentication priority: Automatically uses service account tokens when running in a Kubernetes cluster
- No submodule dependency bloat: Direct resource implementation avoids dependency issues from nested submodules
The provider uses the following priority order for Kubernetes authentication:
- In-cluster config (service account token) - takes precedence
- KUBECONFIG environment variable
- ~/.kube/config file
This ensures that when running inside a Kubernetes cluster, the provider automatically uses the mounted service account token.
| Variable | Required | Default | Description |
|---|---|---|---|
CLUSTER_ID |
No | "na" |
Cluster identifier for resource labeling |
Creates a Tekton Task and StepAction for Kubernetes-based workflows with automatic credential management.
name(String, Required): Display name of the Tekton Taskdescription(String, Optional): Description of the Tekton Taskfacets_resource_name(String, Required): Resource name as defined in the Facets blueprintfacets_environment(Object, Required): Facets-managed environment configurationunique_name(String, Required): Unique name of the environment
facets_resource(Object, Required): Resource definition as specified in the Facets blueprintkind(String, Required): Resource kindflavor(String, Required): Resource flavorversion(String, Required): Resource versionspec(Dynamic, Required): Additional resource specifications
namespace(String, Optional): Kubernetes namespace for Tekton resources (default: "tekton-pipelines")steps(List of Objects, Required): List of steps for the Tekton Taskname(String, Required): Step nameimage(String, Required): Container image for the stepscript(String, Required): Script to execute in the stepresources(Object, Optional): Compute resources for the steprequests(Map of Strings, Optional): Minimum compute resources (e.g., cpu, memory)limits(Map of Strings, Optional): Maximum compute resources
env(List of Objects, Optional): Environment variables for the stepname(String, Required): Environment variable namevalue(String, Required): Environment variable value
params(List of Objects, Optional): List of custom parameters for the Tekton Taskname(String, Required): Parameter nametype(String, Required): Parameter type (e.g., "string", "array")
id(String): Resource identifiertask_name(String): Generated Tekton Task namestep_action_name(String): Generated StepAction name
For detailed documentation and examples, see facets_tekton_action_kubernetes.
Creates a Tekton Task and StepAction for AWS-based workflows with automatic credential management. Supports both inline credentials and IAM role assumption for enhanced security.
Configure AWS credentials in the provider block:
Inline Credentials:
provider "facets" {
aws = {
region = "us-east-1"
access_key = var.aws_access_key
secret_key = var.aws_secret_key
}
}IAM Role Assumption:
provider "facets" {
aws = {
region = "us-east-1"
assume_role = {
role_arn = "arn:aws:iam::123456789012:role/TargetRole"
session_name = "facets-session"
external_id = "unique-id" # Optional
duration = 3600 # Optional (900-43200 seconds)
}
}
}name(String, Required): Display name of the Tekton Taskdescription(String, Optional): Description of the Tekton Taskfacets_resource_name(String, Required): Resource name as defined in the Facets blueprintfacets_environment(Object, Required): Facets-managed environment configurationunique_name(String, Required): Unique name of the environment
facets_resource(Object, Required): Resource definition as specified in the Facets blueprintkind(String, Required): Resource kindflavor(String, Required): Resource flavorversion(String, Required): Resource versionspec(Dynamic, Required): Additional resource specifications
namespace(String, Optional): Kubernetes namespace for Tekton resources (default: "tekton-pipelines")steps(List of Objects, Required): List of steps for the Tekton Taskname(String, Required): Step nameimage(String, Required): Container image for the step (should include AWS CLI)script(String, Required): Script to execute in the stepresources(Object, Optional): Compute resources for the steprequests(Map of Strings, Optional): Minimum compute resources (e.g., cpu, memory)limits(Map of Strings, Optional): Maximum compute resources
env(List of Objects, Optional): Environment variables for the stepname(String, Required): Environment variable namevalue(String, Required): Environment variable value
params(List of Objects, Optional): List of custom parameters for the Tekton Taskname(String, Required): Parameter nametype(String, Required): Parameter type (e.g., "string", "array")
id(String): Resource identifiertask_name(String): Generated Tekton Task namestep_action_name(String): Generated StepAction name for AWS credential setup
For detailed documentation, examples, and authentication methods, see facets_tekton_action_aws.
See INSTALL.md for detailed installation instructions.
Quick Install from GitHub Releases:
# Download from releases page
wget https://github.com/facets-cloud/terraform-provider-facets/releases/download/v0.1.0/terraform-provider-facets_0.1.0_linux_amd64.zip
# Extract and install
unzip terraform-provider-facets_0.1.0_linux_amd64.zip
mkdir -p ~/.terraform.d/plugins/github.com/facets-cloud/facets/0.1.0/linux_amd64
mv terraform-provider-facets_v0.1.0 ~/.terraform.d/plugins/github.com/facets-cloud/facets/0.1.0/linux_amd64/terraform-provider-facets
chmod +x ~/.terraform.d/plugins/github.com/facets-cloud/facets/0.1.0/linux_amd64/terraform-provider-facetsThen use in your Terraform:
terraform {
required_providers {
facets = {
source = "github.com/facets-cloud/facets"
version = "~> 0.1.0"
}
}
}make installOr manually:
go build -o terraform-provider-facetsThe provider is built using the Terraform Plugin Framework and follows these key principles:
- Direct resources over submodules: To avoid dependency bloat, all resources are implemented directly rather than using nested submodules
- In-cluster authentication priority: Service account tokens are automatically used when available
- Type flexibility: Uses dynamic types for fields that accept any structure (environment, instance, params, resources)
Unit Tests:
go test -v ./internal/provider/Integration Tests:
./tests/integration/test.shFor comprehensive local testing instructions including dev overrides, plugin installation, and debugging tips, see:
.
βββ internal/
β βββ k8s/
β β βββ client.go # Kubernetes client with auth priority
β βββ provider/
β βββ provider.go # Provider implementation
β βββ resource_tekton_action_kubernetes.go # Tekton resource
βββ main.go # Provider entry point
βββ go.mod # Go module dependencies
βββ README.md # This file
This provider replaces the Terraform module at:
github.com/Facets-cloud/facets-utility-modules//actions/kubernetes
By implementing the functionality as a native Terraform provider resource instead of a module with submodules, we avoid the dependency bloat issue described in the Facets IAC wiki.