Skip to content

Add periodic drift-detection workflow#160

Merged
JonJagger merged 1 commit into
mainfrom
add-drift-detection
Jul 17, 2026
Merged

Add periodic drift-detection workflow#160
JonJagger merged 1 commit into
mainfrom
add-drift-detection

Conversation

@gsavage

@gsavage gsavage commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Adds a scheduled Detect Drift workflow to this repository, matching the
setup already in web and terraform-base-infra.

The drift terraform plan runs with no build behind it, but the ECS
deployment requires a container image (TF_VAR_TAGGED_IMAGE) that has no
default and is tracked directly by the task definition. So before planning,
each environment reads the image that is currently deployed straight from
its ECS task definition and passes it to the shared kosli-dev/tf drift
workflow. This means the plan reflects real drift rather than failing on a
missing variable or reporting a phantom image change.

The logic lives in a local reusable workflow, detect-drift-env.yml,
parameterized by AWS account and environment. detect-drift.yml holds only
the schedule and a beta/prod matrix that calls it, so there is no
duplication between environments.

The Detect Drift workflow runs a terraform plan with no build behind it,
but the ECS deployment requires a container image (TF_VAR_TAGGED_IMAGE).
The variable has no default and the task definition tracks it directly,
so a drift plan either fails with "no value for required variable" or, if
given a placeholder, reports permanent false drift on the task definition.

Before planning, each environment reads the image that is currently
deployed straight from its ECS task definition and passes it to the
reusable drift workflow as TF_VAR_TAGGED_IMAGE. The image lookup is done
explicitly in this repository rather than in the shared kosli-dev/tf
workflow, so Kosli's own drift detection is unaffected.

The logic lives in a local reusable workflow, detect-drift-env.yml, which
is parameterized by AWS account and environment. detect-drift.yml holds
only the schedule and a beta/prod matrix that calls it, so there is no
duplication between environments and adding another is a two-line change.
@JonJagger
JonJagger merged commit a2e4638 into main Jul 17, 2026
8 checks passed
@JonJagger
JonJagger deleted the add-drift-detection branch July 17, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants