For the complete documentation index, see llms.txt. This page is also available as Markdown.

Terraform Onboarding

Resilience Testing with Terraform

This guide walks you through integrating Resilience Testing into your infrastructure using the Harness Terraform provider. After setting up, you can easily design, schedule, and monitor chaos experiments through Harness Dashboard, ensuring your systems are resilient and production-ready.

Overview

Harness simplifies chaos engineering with Terraform integration that enables you to:

This Terraform provider for chaos engineering is currently supported for Kubernetes infrastructures.

Prerequisites

Infrastructure Provisioning

Use these Terraform resources to set up your chaos engineering infrastructure:

Common Configuration

First, define the common locals block that will be used across all resources:

Chaos Infrastructure

Enable Chaos Engineering on existing Harness infrastructures or provision new ones.

To provision new infrastructures and enable Chaos Engineering in a single workflow, use Harness Platform infrastructure resources first, then apply Harness Chaos Engineering Terraform resources to enable chaos capabilities.

Resource: harness_chaos_infrastructure_v2 Documentation: harness_chaos_infrastructure_v2

Service Discovery

Configure service discovery to automatically detect services for chaos experiments.

Resource: harness_service_discovery_agent Documentation: service_discovery_agent

Image Registry

Configure custom image registries for chaos experiments.

Resource: harness_chaos_image_registry Documentation: harness_chaos_image_registry

Security Governance

Define security governance rules and conditions for chaos experiments to ensure safe execution in production environments.

Governance Conditions: Define time windows, environment restrictions, and other conditions Resource: harness_chaos_security_governance_condition Documentation: harness_chaos_security_governance_condition

Governance Rules: Apply conditions to specific environments and define actions (block, warn, etc.) Resource: harness_chaos_security_governance_rule Documentation: harness_chaos_security_governance_rule

After Infrastructure Setup

Once your infrastructure is provisioned:

  1. Service Discovery: Your applications will be automatically discovered in the configured environments

  2. Create Experiments: Use the Harness UI to manually create and configure your chaos experiments

  3. Run Experiments: Execute experiments against your discovered services through the platform

Next Steps

Last updated

Was this helpful?