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
- Kitchen configuration can be found in `/.kitchen.yml`
75
75
- Under `/test/fixtures` you can find the targets that will be tested. Please keep this as similar as possible to the Terraform Registry Modules examples.
76
+
- In order to test this in your local environment use following recipee
77
+
```bash
78
+
terraform init -backend=false && \
79
+
terraform validate &&\
80
+
terraform plan && \
81
+
read&&\ # will give you time to review plan or just push enter to apply
82
+
terraform apply --auto-approve
83
+
```
76
84
- AWS_PROFILE configuration is required to access the [TF s3 state backend](#terraform-backend)
77
85
78
-
**Running Kitchen tests locally**
86
+
### Terraform Backend
87
+
88
+
Because CI/CD sometimes fail, we setup the Terraform state to be handled in backend (s3+dynamo) within the Sysdig AWS backend (sysdig-test-account).
89
+
90
+
### Remote state cleanup from local
91
+
92
+
In case you need to handle terraform backend state from failing kitchen tests, some guidance for using the `backend.tf` remote state manifest, present on each test
93
+
- Configure same parameters as the github action, that is `AWS_PROFILE`, and leave default `name` and `region` values
94
+
- Kitchen works with `terraform workspaces` so, in case you want to fix a specific test, switch to that workspace after the `terraform init` with `terraform workspace select WORKSPACE`
95
+
- Perform the desired terraform task
96
+
97
+
You can also use `kitchen destroy` instead of `terraform` but the requirements are the same, except that the workspace will be managed through kitchen
98
+
99
+
100
+
### Running Kitchen tests locally
79
101
80
102
Ruby 2.7 is required to launch the tests.
81
103
Run `bundle install` to get kitchen-terraform bundle.
Because CI/CD sometimes fail, we setup the Terraform state to be handled in backend (s3+dynamo) within the Sysdig AWS backend (sysdig-test-account).
101
-
In order to be able to use this Terraform backend AWS credentials are configured as Github project secret
102
-
103
-
If terraform state ends up in bad shape and not cleaned, use the action called `Test Cleanup` that should destroy any messed situation.
104
-
If this does not work, try it from your local, but please do it using `kitchen destroy`, not `terraform destroy` unless you really know what you're doing :]
119
+
Note: As said before kitchen works with workspaces, so any local test, unless you change it, will fall into the `default` workspace and will not collide with
120
+
Github Action tests. May collide however with other peers if they're doing similar tasks on local ;)
121
+
You can always temporary delete the `backend.tf` file on the test you're running
0 commit comments