You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once you execute Terraform an apply the manifests, that env vars will be used to configure
88
-
the provider and create API calls with them.
67
+
Once you execute Terraform and apply the manifests, that env vars will be used to configure
68
+
the provider and create API calls.
89
69
90
70
### Configure the provider: Using a tfvars file
91
71
92
72
To use a [tfvars file](https://www.terraform.io/docs/configuration/variables.html#variable-definitions-tfvars-files)
93
-
you need to first create it, and specify the API tokens as variables, for example:
73
+
you need to first create it, and specify the API tokens as [variables](https://www.terraform.io/docs/configuration/variables.html), for example:
94
74
95
75
```
96
76
# File: terraform.tfvars
@@ -110,11 +90,14 @@ provider "sysdig" {
110
90
111
91
### Creating resources with Terraform
112
92
113
-
We are going to create a pair of rules able to detect SSH connections and shells spawned in containers.
93
+
This is an example to create a pair of rules able to detect SSH connections and
94
+
shells spawned in containers.
114
95
115
-
We start by defining a couple of rules in the `rules.tf` file. One rule will detect inbound and outbound connections
96
+
Start by defining a couple of rules in the `rules.tf` file. One rule will detect inbound and outbound connections
116
97
made to the port 22, and the other will detect a shell process being spawned.
117
98
99
+
For more information about the configuration blocks, see: [https://www.terraform.io/docs/configuration/syntax.html](https://www.terraform.io/docs/configuration/syntax.html)
If we do a `terraform apply`, it will tell us that it will create 2 new resources and modify the existing policy:
222
+
Finally, doing a `terraform apply`, it will inform that it will create 2 new resources and modify the existing policy:
240
223
241
224

242
225
243
-
After inputting **yes**, Terraform will create the notification channels and bind them to the policy, ensuring that the state in Monitor and Secure matches our state defined in the code.
226
+
After inputting **yes**, Terraform will create the notification channels and bind them to the policy,
227
+
ensuring that the state in Monitor and Secure matches our state defined in the code.
244
228
245
-
We can see those new resources appearing on Sysdig UI:
229
+
This is how the resources appear on the Sysdig Secure UI:
246
230
247
231

248
232
249
233

250
234
251
-
Now, if someone tries to update it manually, we can always re-apply our policies, and Terraform will
252
-
restore the desired status from our`.tf` manifests.
235
+
Now, if someone tries to update it manually, by re-applying the policies, Terraform will
236
+
restore the desired status from the`.tf` manifests.
253
237
254
-
## Reference to resources documentation
238
+
## Full Terraform resources documentation
255
239
256
-
You can check all the available resources and datasources for the Terraform Provider for Sysdig here:
240
+
Check all the available resources and datasources for the Terraform Provider for Sysdig here:
257
241
258
242
[Terraform provider for Sysdig Datasources](./usage.md)
0 commit comments