Skip to content

Commit 41bbd5c

Browse files
wip
1 parent 311d66b commit 41bbd5c

File tree

1 file changed

+39
-49
lines changed

1 file changed

+39
-49
lines changed

docs/chaos-engineering/guides/terraform-onboarding.md

Lines changed: 39 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,13 @@ To provision new infrastructures and enable Chaos Engineering in a single workfl
7070

7171
```hcl
7272
resource "harness_chaos_infrastructure_v2" "this" {
73-
depends_on = [
74-
harness_platform_infrastructure.this
75-
]
76-
7773
// Required fields
78-
org_id = local.org_id
79-
project_id = local.project_id
80-
environment_id = harness_platform_environment.this.id
81-
infra_id = harness_platform_infrastructure.this.id
82-
name = var.chaos_infra_name
83-
description = var.chaos_infra_description
74+
org_id = "your_org_id"
75+
project_id = "your_project_id"
76+
environment_id = "your_environment_id"
77+
infra_id = "your_infrastructure_id"
78+
name = "chaos-infra"
79+
description = "Chaos Engineering Infrastructure"
8480
}
8581
```
8682

@@ -93,20 +89,17 @@ Configure service discovery to automatically detect services for chaos experimen
9389

9490
```hcl
9591
resource "harness_service_discovery_agent" "this" {
96-
depends_on = [
97-
harness_chaos_infrastructure_v2.this
98-
]
99-
100-
name = var.service_discovery_agent_name
101-
org_identifier = local.org_id
102-
project_identifier = local.project_id
103-
environment_identifier = harness_platform_environment.this.id
104-
infra_identifier = harness_platform_infrastructure.this.id
105-
installation_type = var.sd_installation_type
92+
// Required fields
93+
name = "service-discovery-agent"
94+
org_identifier = "your_org_id"
95+
project_identifier = "your_project_id"
96+
environment_identifier = "your_environment_id"
97+
infra_identifier = "your_infrastructure_id"
98+
installation_type = "kubernetes"
10699
107100
config {
108101
kubernetes {
109-
namespace = var.sd_namespace
102+
namespace = "harness-delegate-ng"
110103
}
111104
}
112105
}
@@ -122,11 +115,11 @@ Configure custom image registries for chaos experiments.
122115
```hcl
123116
resource "harness_chaos_image_registry" "project_level" {
124117
// Required fields
125-
org_id = local.org_id
126-
project_id = local.project_id
118+
org_id = "your_org_id"
119+
project_id = "your_project_id"
127120
128-
registry_server = var.registry_server
129-
registry_account = var.registry_account
121+
registry_server = "docker.io"
122+
registry_account = "your_registry_account"
130123
}
131124
```
132125

@@ -141,21 +134,18 @@ Define security governance rules and conditions for chaos experiments to ensure
141134
```hcl
142135
resource "harness_chaos_security_governance_condition" "this" {
143136
// Required fields
144-
name = var.security_governance_condition_name
137+
name = "block-destructive-faults"
145138
description = "Condition to block destructive experiments"
146-
org_id = local.org_id
147-
project_id = local.project_id
148-
infra_type = var.security_governance_condition_infra_type
139+
org_id = "your_org_id"
140+
project_id = "your_project_id"
141+
infra_type = "kubernetes"
149142
150143
fault_spec {
151-
operator = var.security_governance_condition_operator
144+
operator = "EQUAL"
152145
153-
dynamic "faults" {
154-
for_each = var.security_governance_condition_faults
155-
content {
156-
fault_type = faults.value.fault_type
157-
name = faults.value.name
158-
}
146+
faults {
147+
fault_type = "pod-delete"
148+
name = "pod-delete"
159149
}
160150
}
161151
}
@@ -168,12 +158,12 @@ resource "harness_chaos_security_governance_condition" "this" {
168158
```hcl
169159
resource "harness_chaos_security_governance_rule" "this" {
170160
// Required fields
171-
name = var.security_governance_rule_name
172-
description = var.security_governance_rule_description
173-
org_id = local.org_id
174-
project_id = local.project_id
161+
name = "production-safety-rule"
162+
description = "Block destructive experiments in production"
163+
org_id = "your_org_id"
164+
project_id = "your_project_id"
175165
condition_ids = [harness_chaos_security_governance_condition.this.id]
176-
user_group_ids = var.security_governance_rule_user_group_ids
166+
user_group_ids = ["your_user_group_id"]
177167
}
178168
```
179169

@@ -188,14 +178,14 @@ Manage custom ChaosHubs to provide organization, account or project level fault,
188178
```hcl
189179
resource "harness_chaos_hub" "this" {
190180
// Required fields
191-
org_id = local.org_id
192-
project_id = local.project_id
193-
name = var.chaos_hub_name
194-
description = var.chaos_hub_description
195-
196-
connector_id = var.chaos_hub_connector_id
197-
repo_branch = var.chaos_hub_repo_branch
198-
repo_name = var.chaos_hub_repo_name
181+
org_id = "your_org_id"
182+
project_id = "your_project_id"
183+
name = "custom-chaos-hub"
184+
description = "Custom ChaosHub for organization experiments"
185+
186+
connector_id = "your_git_connector_id"
187+
repo_branch = "main"
188+
repo_name = "chaos-experiments"
199189
}
200190
```
201191

0 commit comments

Comments
 (0)