ankra Provider
The Ankra Terraform provider lets you manage Kubernetes clusters, stacks, manifests, and addons on the Ankra platform using Terraform.Example Usage
Provider Schema
Name | Type | Required | Description |
---|---|---|---|
ankra_token | String | Yes | The API token for authenticating with Ankra. |
Pre-configured Stack Example
Data Sources
ankra_clusters
This data source retrieves a list of clusters from the Ankra platform.Example: Realistic Monitoring Stack
Suppose you have these files in your module directory:manifests/grafana-namespace.yaml
:
manifests/prometheus-namespace.yaml
:
manifests/loki-namespace.yaml
:
add-ons/grafana/values.yaml
, etc.
Complete Example: Using from_file for Manifests and Addons
Suppose you have these files in your module directory:namespace.yaml
:
secret.yaml
:
Importing a Cluster
If a cluster is created or modified outside of Terraform (for example, via GitOps, CLI, or the Ankra UI), you can import it into your Terraform state:<cluster_id>
with the actual ID of the cluster you want to manage with Terraform. After import, run terraform plan
to review any differences and update your configuration as needed.
Provider & Data Source Schema
Provider
Name | Type | Required | Description |
---|---|---|---|
ankra_token | String | Yes | The API token for authenticating with Ankra. |
Data Source: ankra_clusters
Name | Type | Description |
---|---|---|
clusters | List | List of cluster objects. |
Cluster Object
Name | Type | Description |
---|---|---|
id | String | The cluster ID. |
name | String | The cluster name. |
For more details, see the Ankra Terraform Provider Registry.