This module deploys the Data Source Connector (DSC) via Helm into an IBM Kubernetes Service (IKS) or Red Hat OpenShift on IBM Cloud cluster, registers the cluster with IBM Backup & Recovery Service, and creates a configurable protection policy.
It automates:
- Security group rules for DSC-to-BRS communication
- Helm deployment of the DSC chart
- ServiceAccount + token generation
- Cluster registration with IBM B&R
- Flexible backup policy with incremental schedules, retention, and optional data lock (WORM)
For detailed guidance on configuring Kubernetes Protection Groups, including limitations, best practices, and working examples, see:
Protection Group Configuration Guide
- terraform-ibm-iks-ocp-backup-recovery
- Examples ℹ️ Ctrl/Cmd+Click or right-click on the Schematics deploy button to open in a new tab.
- Deployable Architectures
- Contributing
# ############################################################################
# Init cluster config for helm
# ############################################################################
data "ibm_container_cluster_config" "cluster_config" {
cluster_name_id = "xxxxxxxxx" # replace with cluster ID or name
}
# ############################################################################
# Config providers
# ############################################################################
provider "ibm" {
ibmcloud_api_key = "xxxxxxxxxxxx" # pragma: allowlist secret
}
provider "helm" {
kubernetes {
host = data.ibm_container_cluster_config.cluster_config.host
token = data.ibm_container_cluster_config.cluster_config.token
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
}
registries = [
{ url = "oci://icr.io", username = "iamapikey", password = var.ibmcloud_api_key } # pragma: allowlist secret
]
}
provider "kubernetes" {
host = data.ibm_container_cluster_config.cluster_config.host
token = data.ibm_container_cluster_config.cluster_config.token
cluster_ca_certificate = data.ibm_container_cluster_config.cluster_config.ca_certificate
}
# ############################################################################
# Install DSC
# ############################################################################
module "backup_recovery" {
source = "terraform-ibm-modules/iks-ocp-backup-recovery/ibm"
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
cluster_id = "xxxxxxx" # replace with ID of the cluster
cluster_resource_group_id = "xxxxxxx" # replace with ID of the cluster resource group
dsc_registration_token = "xxxxxxx" # replace with Registration_token
connection_id = "xxxxxxx" # replace with connection ID
# --- B&R Instance ---
brs_instance_guid = "xxxxxxx" # replace with ID of the BRS instance
brs_instance_region = var.region
brs_endpoint_type = "public"
brs_tenant_id = "xxxxxxx" # replace with tenant ID of the BRS instance
# --- Backup Policy ---
policy = {
name = "daily-with-monthly-retention"
schedule = {
unit = "Hours"
frequency = 24
}
retention = {
duration = 4
unit = "Weeks"
}
use_default_backup_target = true
}
}This module supports automatic recovery that runs in the same terraform apply as the backup, with no manual intervention required:
module "backup_recovery" {
source = "terraform-ibm-modules/iks-ocp-backup-recovery/ibm"
version = "X.Y.Z"
# ... cluster and BRS configuration ...
# Protection groups define what to backup
protection_groups = [{
name = "production-backup"
policy_name = "daily-retention"
objects = [{
name = "production-namespace"
}]
}]
# Enable automatic recovery after backup completes
enable_recovery = true
recovery_mode = "same-cluster" # or "cross-cluster"
wait_for_backup_completion = 30 # minutes to wait for initial backup
# Recovery operations (triggered automatically after backup)
recoveries = [{
name = "restore-production-namespace"
snapshot_environment = "kKubernetes"
kubernetes_params = {
recovery_action = "RecoverNamespaces"
objects = [{
snapshot_id = "latest" # Uses latest snapshot automatically
protection_group_name = "production-backup"
}]
}
}]
}Restore backups within the same cluster (default mode):
module "backup_recovery" {
source = "terraform-ibm-modules/iks-ocp-backup-recovery/ibm"
version = "X.Y.Z"
cluster_id = "my-cluster"
cluster_resource_group_id = "xxxx"
# ... other required variables ...
# Same-cluster recovery configuration
enable_recovery = true
recovery_mode = "same-cluster"
wait_for_backup_completion = 30
protection_groups = [{
name = "app-backup"
policy_name = "daily-retention"
objects = [{ name = "app-namespace" }]
}]
recoveries = [{
name = "restore-app"
snapshot_environment = "kKubernetes"
kubernetes_params = {
recovery_action = "RecoverNamespaces"
objects = [{
protection_group_name = "app-backup"
snapshot_id = "latest"
}]
}
}]
}Restore backups from a source cluster to a different target cluster:
module "backup_recovery" {
source = "terraform-ibm-modules/iks-ocp-backup-recovery/ibm"
version = "X.Y.Z"
# Source cluster (where backups are taken)
cluster_id = "source-cluster"
cluster_resource_group_id = "source-rg-id"
# ... other required variables ...
# Cross-cluster recovery configuration
enable_recovery = true
recovery_mode = "cross-cluster"
target_cluster_id = "target-cluster"
target_cluster_resource_group_id = "target-rg-id"
wait_for_backup_completion = 45 # May need more time for cross-cluster
protection_groups = [{
name = "production-backup"
policy_name = "daily-retention"
objects = [{ name = "production-namespace" }]
}]
recoveries = [{
name = "restore-to-target-cluster"
snapshot_environment = "kKubernetes"
kubernetes_params = {
recovery_action = "RecoverNamespaces"
objects = [{
protection_group_name = "production-backup"
snapshot_id = "latest"
}]
}
}]
}Important Notes for Cross-Cluster Recovery:
- Target cluster must be pre-registered with the same BRS instance
- Target cluster must have the Data Source Connector installed
- Network connectivity must exist between source and target clusters
- Ensure target cluster has sufficient resources for the restored workloads
To perform recovery manually without automatic triggering after backup:
module "backup_recovery" {
source = "terraform-ibm-modules/iks-ocp-backup-recovery/ibm"
version = "X.Y.Z"
# ... cluster configuration ...
# Disable automatic recovery
enable_recovery = false
# Define recovery operations (will not execute automatically)
recoveries = [{
name = "manual-restore"
snapshot_environment = "kKubernetes"
kubernetes_params = {
recovery_action = "RecoverNamespaces"
objects = [{
snapshot_id = "specific-snapshot-id-here"
protection_group_id = "pg-456"
}]
}
}]
}Then enable recovery when needed:
# Enable recovery in your terraform.tfvars
echo 'enable_recovery = true' >> terraform.tfvars
terraform applyYou need the following permissions to run this module:
- Backup & Recovery service
Editorplatform access
- VPC Infrastructure
Editoron security groups (for DSC outbound rules)
- Kubernetes Service
Editorplatform access
| Name | Version |
|---|---|
| terraform | >= 1.9.0 |
| helm | >=3.1.0, <4.0.0 |
| ibm | >= 2.2.2, < 3.0.0 |
| kubernetes | >=3.0.1, <4.0.0 |
| time | >=0.12.1, <1.0.0 |
| Name | Source | Version |
|---|---|---|
| backup_recovery_instance | terraform-ibm-modules/backup-recovery/ibm | 1.12.4 |
| brs_s2s_auth | terraform-ibm-modules/s2s-auth/ibm | 2.3.1 |
| brs_vpe | terraform-ibm-modules/vpe-gateway/ibm | 5.3.5 |
| crn_parser | terraform-ibm-modules/common-utilities/ibm//modules/crn-parser | 1.5.0 |
| dsc_sg_rule | terraform-ibm-modules/security-group/ibm | v2.9.1 |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| access_tags | Add existing access management tags to the Backup Recovery instance to manage access. | list(string) |
[] |
no |
| add_cluster_tags | Whether to add BRS tags to the cluster. Set to false if you manage cluster tags externally to avoid drift. When false, you should manually add the tags 'brs-region:' and 'brs-guid:' to your cluster. | bool |
true |
no |
| add_dsc_rules_to_cluster_sg | Set to true to automatically add the security group rules required by the Data Source Connector. This is mandatory when registering the cluster via its public service endpoint. Set to false to only register the cluster and create the policy without modifying security groups. |
bool |
false |
no |
| auto_protect_policy_name | Name of an existing protection policy to use for auto-protect. Required when enable_auto_protect is true and deployment_mode is 'backup_only' or 'full_backup_recovery'. The policy must already exist in the BRS instance (create it using the terraform-ibm-backup-recovery module). |
string |
null |
no |
| backup_run_poll_interval_seconds | Polling interval in seconds when waiting for the first restorable backup run. | number |
30 |
no |
| backup_run_poll_timeout_minutes | Maximum time in minutes to poll for the first restorable backup run when recovery is enabled in a single apply. | number |
45 |
no |
| brs_connection_name | Name of the connection from the Backup & Recovery Service instance to be used for protecting the cluster. If brs_create_new_connection is set to true (default), this will be the name of the new connection created. If set to false, this must be the name of an existing connection. |
string |
n/a | yes |
| brs_create_new_connection | Flag to create a new connection from the Backup & Recovery Service instance to the cluster. When set to true (default), a new connection is created with the name specified in brs_connection_name. When false, it uses an existing connection matching brs_connection_name. |
bool |
true |
no |
| brs_endpoint_type | The endpoint type to use when connecting to the Backup and Recovery service for Terraform provider operations and script calls. Allowed values are 'public' or 'private'. When create_brs_vpe=true and this is set to 'private', the DSC pods reach BRS over the Virtual Private Endpoint Gateway (VPE) instead of the IBM Cloud Service Endpoint (CSE) — the BRS endpoint URL is automatically overridden to the VPE DNS hostname inside the cluster VPC. |
string |
"private" |
no |
| brs_instance_name | Name of the Backup & Recovery Service instance. Required only when existing_brs_instance_crn is not provided. |
string |
null |
no |
| brs_resource_group_id | The ID of the resource group where the BRS instance will be created. If this value is null, cluster_resource_group_id is used by default. This is suitable when the cluster and the BRS instance are in the same IBM Cloud account. Set this to a resource group in the target account when the BRS instance lives in a different IBM Cloud account from the cluster. |
string |
null |
no |
| brs_service_type | The IBM Cloud service name for the Backup and Recovery instance. Use the default backup-recovery for production. Set to backup-recovery-tests to provision or connect against the test-environment service. |
string |
"backup-recovery" |
no |
| brs_vpe_name | Override the name of the BRS Virtual Private Endpoint Gateway. If null, the name is auto-generated as '<brs_connection_name>-vpe'. | string |
null |
no |
| cluster_config_endpoint_type | The type of endpoint to use for the cluster config access: default, private, vpe, or link. The default value uses the default endpoint of the cluster. |
string |
"default" |
no |
| cluster_id | The ID of the cluster designated for backup and recovery. | string |
n/a | yes |
| cluster_resource_group_id | Resource group ID the cluster is deployed in. | string |
n/a | yes |
| connection_env_type | Connection environment type to determine the required parameters for creating a new connection. Must be consistent with kube_type (use kIks* for kubernetes, kRoks* for openshift). Allowed values are 'kIksVpc', 'kRoksVpc', 'kRoksClassic', and 'kIksClassic'. |
string |
n/a | yes |
| create_brs_vpe | Set to true to create a Virtual Private Endpoint Gateway (VPEG) that routes traffic from the cluster VPC to the BRS instance over the IBM private backbone. For existing clusters, vpc_id and vpc_subnets are auto-discovered from the cluster's worker pools. When creating a new cluster in the same apply, supply vpc_id and vpc_subnets explicitly (the auto-discovery reads worker pools, which are unknown until after the cluster is applied). For cross-account setups (BRS in a different IBM Cloud account), the required S2S IAM authorization policy is created automatically when the module detects that the ibm.cluster provider belongs to a different account than the default ibm provider. |
bool |
false |
no |
| create_dsc_worker_pool | Set to true to create a dedicated worker pool for the Data Source Connector in VPC clusters. If set to false, the connector will be deployed on existing worker nodes. |
bool |
true |
no |
| create_new_brs_instance | Whether to provision a new Backup & Recovery Service instance. Leave as null (default) to infer the behaviour from existing_brs_instance_crn (a new instance is created when the CRN is not provided). Set to false to reuse an existing instance whose CRN is only known after apply — for example, when this module registers a second cluster against an instance created by a first invocation in the same apply. |
bool |
null |
no |
| deployment_mode | Deployment mode to control what components are deployed: - 'backup_only' (default): Registers source cluster with BRS, configures protection groups. No target cluster, no recovery. - 'connected_component': Registers both source + target clusters with BRS for cluster connection setup only. No backup or recovery triggered. - 'full_backup_recovery': End-to-end: registers clusters, triggers on-demand backup, waits for completion, executes recovery to validate. |
string |
"backup_only" |
no |
| dsc_chart_uri | The full OCI registry URI for the Data Source Connector Helm chart, including the digest. | string |
"oci://icr.io/brs-charts/brs-ds-connector-chart:7.3.12-release-20260713-2e7241a2@sha256:b6a39948f5d1b6f765d0e73ebd2dd9c700ba0d5d5a120969efdfce2f75e8467e" |
no |
| dsc_helm_timeout | Timeout in seconds for the Data Source Connector Helm deployment. | number |
7200 |
no |
| dsc_name | Release name for the Data Source Connector Helm deployment. | string |
"dsc" |
no |
| dsc_namespace | The cluster namespace where the Data Source Connector will be installed. Will be created if it does not exist. | string |
"ibm-brs-data-source-connector" |
no |
| dsc_pod_cpu_limits | CPU limit for each Data Source Connector pod (e.g., '4', '8'). Should match or exceed the worker node's available CPU. | string |
"4" |
no |
| dsc_pod_cpu_requests | CPU request for each Data Source Connector pod (e.g., '2', '4'). This is the guaranteed CPU allocation. | string |
"2" |
no |
| dsc_pod_memory_limits | Memory limit for each Data Source Connector pod (e.g., '8Gi', '16Gi'). Should match or exceed the worker node's available memory. | string |
"8Gi" |
no |
| dsc_pod_memory_requests | Memory request for each Data Source Connector pod (e.g., '5Gi', '10Gi'). This is the guaranteed memory allocation. | string |
"5Gi" |
no |
| dsc_replicas | Number of Data Source Connector pods to run. Recommended values: • 3 – for high availability across multiple nodes/zones (strongly recommended in production) • 1 – only for dev/test or single-node clusters |
number |
1 |
no |
| dsc_storage_class | Storage class to use for the Data Source Connector persistent volume. By default, it uses 'ibmc-vpc-block-metro-5iops-tier' for VPC clusters and 'ibmc-block-silver' for Classic clusters. | string |
null |
no |
| dsc_worker_pool_flavor | The machine flavor for the Data Source Connector worker pool. bxf.4x16 (4 vCPU, 16 GB RAM) is available in every IBM Cloud VPC zone. Override for a larger flavor (e.g. bxf.8x32). |
string |
"bxf.4x16" |
no |
| dsc_worker_pool_zones | Number of zones to create worker pools in. Defaults to 1 for single-zone deployments. Set to 2 or 3 for multi-zone high availability. Must be between 1 and 3. | number |
1 |
no |
| enable_auto_protect | Enable auto-protect during the initial cluster registration. This must be set to true on the first run; toggling it from false to true later is not supported by the underlying API and will not retroactively create the protection group. |
bool |
true |
no |
| existing_brs_instance_crn | CRN of the Backup & Recovery Service instance. Supports both production (backup-recovery) and test (backup-recovery-tests) service instances. |
string |
null |
no |
| ibmcloud_api_key | The IBM Cloud api key to generate an IAM token. | string |
n/a | yes |
| install_required_binaries | When set to true, a script will run to check if kubectl and jq, IBM Cloud CLI (ibmcloud), and the backup-recovery plugin exist on the runtime and if not attempt to download them from the public internet and install them to /tmp. Set to false to skip running this script. |
bool |
true |
no |
| kube_type | Specify the type of target cluster for the backup and recovery. Accepted values are openshift or kubernetes. |
string |
"openshift" |
no |
| policies | A list of protection policies to create or look up. Set create_new_policy to true (default) to create a new policy with the specified schedule and retention. Set create_new_policy to false to reference an existing policy by name. |
list(object({ |
null |
no |
| protection_groups | List of protection groups for granular backup control. Each group selects specific namespaces/objects and applies a policy. Use this as an alternative to enable_auto_protect for fine-grained control over which workloads are backed up. |
list(object({ |
[] |
no |
| recoveries | List of recovery operations to restore backups. These operations are triggered automatically after a backup run completes when recovery is enabled by the calling module. Each entry's kubernetes_params.objects[*].snapshot_id controls which backup is restored: supply an explicit snapshot ID to recover from any specific backup (not necessarily the one taken in the current apply), or use the latest_snapshots output to reference the most recent run. Supports multiple environments: Kubernetes, VMware, Physical, AWS, Azure, GCP, SQL, Oracle, and more. This variable follows the official IBM Backup Recovery provider schema. For IKS/ROKS recovery use kubernetes_params. See the Usage section in the README for examples. |
list(object({ |
[] |
no |
| recovery_mode | Recovery mode: 'same-cluster' to restore within the same cluster, or 'cross-cluster' to restore to a different target cluster. This is used when recovery is enabled by the calling module. | string |
"same-cluster" |
no |
| region | Region where the Backup & Recovery Service instance needs to be created. | string |
null |
no |
| registration_images | The images required for backup and recovery registration. | object({ |
{ |
no |
| resource_tags | Add user resource tags to the Backup Recovery instance to organize, track, and manage costs. | list(string) |
[] |
no |
| target_cluster_id | Target cluster ID for cross-cluster recovery or connected component setup. Required when var.recovery_mode is 'cross-cluster' or when deployment_mode is 'connected_component'. Must be a cluster already registered with the BRS instance. |
string |
null |
no |
| target_cluster_resource_group_id | Resource group ID of the target cluster for cross-cluster recovery or connected component setup. Required when recovery_mode is 'cross-cluster' or when deployment_mode is 'connected_component'. |
string |
null |
no |
| vpc_id | ID of the VPC where the BRS Virtual Private Endpoint Gateway will be created. Optional when create_brs_vpe is true — when omitted the VPC ID is auto-discovered from the cluster's worker-pool subnets. Supply this explicitly only when the auto-discovery would pick the wrong VPC. | string |
null |
no |
| vpc_subnets | List of subnets in which to bind reserved IPs for the BRS VPE Gateway. Each entry must have 'name', 'id', and 'zone'. Optional when create_brs_vpe is true — when omitted all subnets in the cluster VPC are discovered automatically. Supply this explicitly to restrict the VPEG to a specific subset of subnets. | list(object({ |
[] |
no |
| wait_till | To avoid long wait times when you run your Terraform code, you can specify the stage when you want Terraform to mark the cluster resource creation as completed. Depending on what stage you choose, the cluster creation might not be fully completed and continues to run in the background. However, your Terraform code can continue to run without waiting for the cluster to be fully created. Supported args are MasterNodeReady, OneWorkerNodeReady, IngressReady and Normal |
string |
"Normal" |
no |
| wait_till_timeout | Timeout for wait_till in minutes. | number |
90 |
no |
| Name | Description |
|---|---|
| auto_protect_pg_id | ID of the auto-protect protection group created by BRS when enable_auto_protect=true. Null when auto-protect is not enabled or the registration has not yet propagated. |
| backup_runs_summary | Summary of backup runs per protection group. Shows run count and latest run status. Empty if recovery is not enabled by the calling module. |
| brs_instance_crn | CRN of the Backup & Recovery Service instance |
| brs_instance_guid | GUID of the Backup & Recovery Service instance |
| brs_instance_url | Endpoint URL for the BRS instance, derived from the IBM Cloud resource extensions. Correct for both staging and production environments. |
| brs_tags | BRS tags that should be added to the cluster to prevent tag drift. Include these in your cluster's tags input. |
| brs_tenant_id | Tenant ID of the Backup & Recovery Service instance |
| brs_vpe_ips | Map of VPEG name to reserved IP list. Populated only when create_brs_vpe = true; empty map otherwise. Each entry contains the private IPs bound to each subnet zone. |
| connection_id | ID of the data source connection to the Backup & Recovery Service instance |
| latest_snapshots | Map of protection group names to the most recent successful snapshot ID per protection group. Populated only when recovery is enabled by the calling module, because snapshot discovery relies on the backup-polling infrastructure (terraform_data.wait_for_backup_run and data.ibm_backup_recovery_protection_group_runs) that is activated when recovery is enabled. Use the snapshot IDs from this output as explicit snapshot_id values in a recovery's kubernetes_params.objects to target a specific backup rather than always recovering the latest. |
| protection_group_ids | Map of protection group names to their IDs. Empty if protection groups are not deployed. |
| protection_sources | List of protection sources. |
| recovery_ids | Map of recovery operation names to their IDs. Empty if recovery is not enabled. |
| recovery_status | Map of recovery operation names to their status information. Empty if recovery is not enabled by the calling module. |
| s2s_auth_policies | S2S IAM authorization policies created in this account. Populated only for cross-account VPE deployments (when ibm.cluster and ibm provider resolve to different accounts); empty map otherwise. |
| source_registration_id | ID of the registered Kubernetes source. |
| target_cluster_id | Target cluster ID for recovery operations. Same as source cluster for same-cluster recovery mode. |
You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.
To set up your local development environment, see Local development setup in the project documentation.
| Name | Version |
|---|---|
| terraform | >= 1.9.0 |
| helm | >=3.1.0, <4.0.0 |
| ibm | >= 1.88.3, < 3.0.0 |
| kubernetes | >=3.0.1, <4.0.0 |
| time | >=0.12.1, <1.0.0 |
| Name | Version |
|---|---|
| helm | 3.1.1 |
| ibm | 2.1.0 |
| kubernetes | 3.1.0 |
| terraform | n/a |
| time | 0.14.0 |
| Name | Source | Version |
|---|---|---|
| backup_recovery_instance | terraform-ibm-modules/backup-recovery/ibm | v1.10.2 |
| crn_parser | terraform-ibm-modules/common-utilities/ibm//modules/crn-parser | 1.5.0 |
| dsc_sg_rule | terraform-ibm-modules/security-group/ibm | v2.9.0 |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| access_tags | Add existing access management tags to the Backup Recovery instance to manage access. | list(string) |
[] |
no |
| add_cluster_tags | Whether to add BRS tags to the cluster. Set to false if you manage cluster tags externally to avoid drift. When false, you should manually add the tags 'brs-region:' and 'brs-guid:' to your cluster. | bool |
true |
no |
| add_dsc_rules_to_cluster_sg | Set to true to automatically add the security group rules required by the Data Source Connector. This is mandatory when registering the cluster via its public service endpoint. Set to false to only register the cluster and create the policy without modifying security groups. |
bool |
true |
no |
| auto_protect_policy_name | Name of an existing protection policy to use for auto-protect. Required when enable_auto_protect is true. The policy must already exist in the BRS instance (create it using the terraform-ibm-backup-recovery module). |
string |
null |
no |
| backup_run_poll_interval_seconds | Polling interval in seconds when waiting for the first restorable backup run. | number |
30 |
no |
| backup_run_poll_timeout_minutes | Maximum time in minutes to poll for the first restorable backup run when recovery is enabled in a single apply. | number |
45 |
no |
| brs_connection_name | Name of the connection from the Backup & Recovery Service instance to be used for protecting the cluster. If brs_create_new_connection is set to true (default), this will be the name of the new connection created. If set to false, this must be the name of an existing connection. |
string |
n/a | yes |
| brs_create_new_connection | Flag to create a new connection from the Backup & Recovery Service instance to the cluster. When set to true (default), a new connection is created with the name specified in brs_connection_name. When false, it uses an existing connection matching brs_connection_name. |
bool |
true |
no |
| brs_endpoint_type | The endpoint type to use when connecting to the Backup and Recovery service for creating a data source connection. Allowed values are 'public' or 'private'. | string |
"private" |
no |
| brs_instance_name | Name of the Backup & Recovery Service instance. Required only when existing_brs_instance_crn is not provided. |
string |
null |
no |
| cluster_config_endpoint_type | The type of endpoint to use for the cluster config access: default, private, vpe, or link. The default value uses the default endpoint of the cluster. |
string |
"default" |
no |
| cluster_id | The ID of the cluster designated for backup and recovery. | string |
n/a | yes |
| cluster_resource_group_id | Resource group ID the cluster is deployed in. | string |
n/a | yes |
| connection_env_type | Connection environment type to determine the required parameters for creating a new connection. Allowed values are 'kIksVpc', 'kRoksVpc', 'kRoksClassic', and 'kIksClassic'. | string |
"kIksVpc" |
no |
| create_dsc_worker_pool | Set to true to create a dedicated worker pool for the Data Source Connector in VPC clusters. If set to false, the connector will be deployed on existing worker nodes. |
bool |
true |
no |
| create_new_brs_instance | Whether to provision a new Backup & Recovery Service instance. Leave as null (default) to infer the behaviour from existing_brs_instance_crn (a new instance is created when the CRN is not provided). Set to false to reuse an existing instance whose CRN is only known after apply — for example, when this module registers a second cluster against an instance created by a first invocation in the same apply. |
bool |
null |
no |
| dsc_chart_uri | The full OCI registry URI for the Data Source Connector Helm chart, including the digest. | string |
"oci://icr.io/ext/brs/brs-ds-connector-chart:7.2.18-release-20260226-49768040@sha256:99728a3146a7d8b2ae2f88300a6a89752488d3733e29118ee83a655959114541" |
no |
| dsc_helm_timeout | Timeout in seconds for the Data Source Connector Helm deployment. | number |
3600 |
no |
| dsc_image_version | Container image for the Data Source Connector. | string |
"icr.io/ext/brs/brs-ds-connector:7.2.18-release-20260226-49768040@sha256:99728a3146a7d8b2ae2f88300a6a89752488d3733e29118ee83a655959114541" |
no |
| dsc_name | Release name for the Data Source Connector Helm deployment. | string |
"dsc" |
no |
| dsc_namespace | The cluster namespace where the Data Source Connector will be installed. Will be created if it does not exist. | string |
"ibm-brs-data-source-connector" |
no |
| dsc_replicas | Number of Data Source Connector pods to run. Recommended values: • 3 – for high availability across multiple nodes/zones (strongly recommended in production) • 1 – only for dev/test or single-node clusters |
number |
1 |
no |
| dsc_storage_class | Storage class to use for the Data Source Connector persistent volume. By default, it uses 'ibmc-vpc-block-metro-5iops-tier' for VPC clusters and 'ibmc-block-silver' for Classic clusters. | string |
null |
no |
| enable_auto_protect | Enable auto-protect during the initial cluster registration. This must be set to true on the first run; toggling it from false to true later is not supported by the underlying API and will not retroactively create the protection group. |
bool |
true |
no |
| enable_recovery | Enable automatic recovery after backup completion. When true, recovery operations defined in recoveries will be triggered automatically after successful backup. Set to false to only perform backups without recovery. |
bool |
false |
no |
| existing_brs_instance_crn | CRN of the Backup & Recovery Service instance. | string |
null |
no |
| ibmcloud_api_key | The IBM Cloud api key to generate an IAM token. | string |
n/a | yes |
| install_required_binaries | When set to true, a script will run to check if kubectl and jq, IBM Cloud CLI (ibmcloud), and the backup-recovery plugin exist on the runtime and if not attempt to download them from the public internet and install them to /tmp. Set to false to skip running this script. |
bool |
true |
no |
| kube_type | Specify the type of target cluster for the backup and recovery. Accepted values are openshift or kubernetes. |
string |
"openshift" |
no |
| policies | A list of protection policies to create or look up. Set create_new_policy to true (default) to create a new policy with the specified schedule and retention. Set create_new_policy to false to reference an existing policy by name. |
list(object({ |
null |
no |
| protection_groups | List of protection groups for granular backup control. Each group selects specific namespaces/objects and applies a policy. Use this as an alternative to enable_auto_protect for fine-grained control over which workloads are backed up. |
list(object({ |
[] |
no |
| recoveries | List of recovery operations to restore backups created by protection groups. When enable_recovery is true, these operations will be triggered automatically after backup completion. Supports multiple environments: Kubernetes, VMware, Physical, AWS, Azure, GCP, SQL, Oracle, and more. This variable follows the official IBM Backup Recovery provider schema and can be used across different backup scenarios. For IKS/ROKS recovery, use kubernetes_params. See the Usage section in the README for examples. | list(object({ |
[] |
no |
| recovery_mode | Recovery mode: 'same-cluster' to restore within the same cluster, or 'cross-cluster' to restore to a different target cluster. Required when var.enable_recovery is true. |
string |
"same-cluster" |
no |
| region | Region where the Backup & Recovery Service instance needs to be created. | string |
null |
no |
| registration_images | The images required for backup and recovery registration. | object({ |
{ |
no |
| resource_tags | Add user resource tags to the Backup Recovery instance to organize, track, and manage costs. | list(string) |
[] |
no |
| rollback_on_failure | Flag to automatically rollback the helm chart on installation failure. | bool |
true |
no |
| target_cluster_id | Target cluster ID for cross-cluster recovery. Required when var.recovery_mode is 'cross-cluster'. Must be a cluster already registered with the BRS instance. |
string |
null |
no |
| target_cluster_resource_group_id | Resource group ID of the target cluster for cross-cluster recovery. Required when recovery_mode is 'cross-cluster'. | string |
null |
no |
| wait_for_backup_completion | Wait duration for initial backup to complete before attempting recovery. Specify with time unit suffix (e.g., '5m', '10m', '30m'). Increase this value for large clusters or slow networks. Set to '0s' to disable waiting (recovery will use existing snapshots only). | string |
"5m" |
no |
| wait_till | To avoid long wait times when you run your Terraform code, you can specify the stage when you want Terraform to mark the cluster resource creation as completed. Depending on what stage you choose, the cluster creation might not be fully completed and continues to run in the background. However, your Terraform code can continue to run without waiting for the cluster to be fully created. Supported args are MasterNodeReady, OneWorkerNodeReady, IngressReady and Normal |
string |
"Normal" |
no |
| wait_till_timeout | Timeout for wait_till in minutes. | number |
90 |
no |
| Name | Description |
|---|---|
| backup_runs_summary | Summary of backup runs per protection group. Shows run count and latest run status. Empty if var.enable_recovery is false. |
| brs_instance_crn | CRN of the Backup & Recovery Service instance |
| brs_instance_guid | GUID of the Backup & Recovery Service instance |
| brs_instance_name | Name of the Backup & Recovery Service instance |
| brs_tags | BRS tags that should be added to the cluster to prevent tag drift. Include these in your cluster's tags input. |
| brs_tenant_id | Tenant ID of the Backup & Recovery Service instance |
| connection_id | ID of the data source connection to the Backup & Recovery Service instance |
| latest_snapshots | Map of protection group names to their latest snapshot IDs. Used for automatic recovery. Empty if var.enable_recovery is false. |
| protection_group_ids | Map of protection group names to their IDs |
| protection_sources | List of protection sources |
| recovery_ids | Map of recovery operation names to their IDs. Empty if var.enable_recovery is false. |
| recovery_status | Map of recovery operation names to their status information. Empty if var.enable_recovery is false. |
| source_registration_id | ID of the registered Kubernetes source |
| target_cluster_id | Target cluster ID for recovery operations. Same as source cluster for same-cluster recovery mode. |