Update terraform to add WIZ sensor.#1517
Merged
Merged
Conversation
Collaborator
Author
|
See the SPECIAL note in the PR writeup, to explain the pre-commit issue. |
aloftus23
requested changes
Jul 1, 2026
aloftus23
left a comment
Contributor
There was a problem hiding this comment.
See issue with variables and suggested options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗣 Description
The change updates each task definition to add the Wiz sensor sidecar container, mount it into the main application container(at prod and staging) is testing automation rather than a production runtime workload. Additionally, the changes made in this PR are modifying the Terrafrom dedupe sort script to skip over CLI argument order. The current state CLI arguments are being alphabetized on pre-commit, resulting in task definitions failing.
💭 Motivation and context
This change is required so Wiz Runtime Sensor installation is managed through Terraform instead of manual ECS task definition edits. The environment is redeployed through Terraform as part of normal code deployment, so manually patched ECS task definitions would be overwritten or drift from source control.
By encoding the Wiz sensor setup in Terraform, new ECS task definition revisions consistently include the sensor with no post-deploy manual steps. This supports the ticket acceptance criteria to review Wiz installation documentation, add the sensor to the necessary Terraform-managed platforms, and verify the sensors through the Wiz Console.
The implementation follows Wiz’s ECS/Fargate init-container documentation by adding the sensor sidecar, volumesFrom, dependsOn, SYS_PTRACE, the sensor entrypoint wrapper, and Secrets Manager-backed Wiz credentials.
SPECIAL NOTE regarding PRE-COMMIT failures
The Terraform pre-commit hook currently alphabetizes every JSON heredoc list of strings. That breaks ECS entryPoint arrays because order is semantic: the first element is the executable and the remaining elements are arguments. Wiz’s documentation requires ["/opt/wiz/sensor/wiz-sensor", "daemon", "--"]; sorting changes it to ["--", "/opt/wiz/sensor/wiz-sensor", "daemon"], causing ECS to try to execute --. The hook should skip ordered ECS command fields such as entryPoint and command. We will in the future have to modify our pre-commit to omit this check on the list of string at the ECS entryPoint noted above.
✅ Pre-approval checklist
bump_versionscript if this repository is versioned and the changes in this PR warrant a version bump.✅ Pre-merge checklist
✅ Post-merge checklist