Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4de4b22
add tofu format workflow
Sep 30, 2025
91d9121
add tofu format workflow
Sep 30, 2025
05eb9d4
add tofu format workflow
Sep 30, 2025
7271b79
Add tofu-format-and-validate-diff script
gsf Oct 6, 2025
565a68c
Rewrite tofu-format-and-validate workflow
gsf Oct 6, 2025
393d11b
Clarify directory skipping
gsf Oct 6, 2025
7d78508
Rename to tofu-checks
gsf Oct 15, 2025
6cc0120
Rename step in tofu-checks
gsf Oct 15, 2025
668fc11
Drop workflow_run triggers
gsf Oct 15, 2025
32fcadc
Merge branch 'main' into PLT-212
gsf Oct 15, 2025
0baf2f8
Ref commit hash for checkout in tofu-checks
gsf Oct 15, 2025
32696f4
Add python-checks
gsf Oct 15, 2025
1aad852
Drop pylint and pytest from tf-alarm-to-slack
gsf Oct 15, 2025
69d23ca
Drop terraform lock in api-waf-sync
gsf Oct 15, 2025
970cc5e
Drop whitespace in tf-security-groups
gsf Oct 15, 2025
7833b75
Add tofu-plan workflow
gsf Oct 15, 2025
99d670a
Add todo to alarm-to-slack
gsf Oct 15, 2025
e2da6e5
Add all_services input on tofu-plan
gsf Oct 17, 2025
30c93e2
Fetch all history for tofu-checks and tofu-plan to allow git diff
gsf Oct 17, 2025
28644cf
Switch INFRA_ENVS to TARGET_ENVS
gsf Oct 17, 2025
60d5ab9
Merge branch 'main' into PLT-212
gsf Nov 18, 2025
5f0294f
Add tofu-fmt workflow
gsf Nov 18, 2025
b63f17c
Update tofu-plan script to act on all services
gsf Nov 18, 2025
9e8e65f
Update tofu-plan workflow for script on all services
gsf Nov 18, 2025
679a90a
Add tofu-apply workflow
gsf Nov 18, 2025
5b5a197
Drop tofu-checks
gsf Nov 18, 2025
b77648b
Drop unused services-ecr service
gsf Nov 18, 2025
13a8b70
Drop tf- workflows
gsf Nov 18, 2025
e17ee1c
Improve error handling on tofu init
gsf Nov 18, 2025
ac44190
Drop dpc-prod env from api-waf-sync
gsf Nov 18, 2025
b29fb2d
Use -detailed-exitcode to check errors on tofu plan
gsf Nov 19, 2025
f92d8b3
Update python-checks to use tj-actions
gsf Nov 19, 2025
98daa03
Run python-checks on changed directories
gsf Nov 19, 2025
fdcb505
Drop sidekiq keys from github-actions-role
gsf Nov 20, 2025
f5adb5e
Add grouping for tofu logs
gsf Nov 20, 2025
e996d68
Fix dpc services in each env in github-actions-role
gsf Nov 20, 2025
39d029a
Merge branch 'main' into PLT-212
gsf Nov 20, 2025
c245f74
Update for added config service
gsf Nov 20, 2025
97051e0
Merge branch 'main' into PLT-212
gsf Nov 20, 2025
12e4701
Add sops and yq setup to plan workflow
gsf Nov 20, 2025
8bf1a32
Add link to run log
gsf Nov 20, 2025
c46e57f
Drop link to run as it lacks job ID
gsf Nov 20, 2025
fcff0e6
Switch from exclamation to x emoji
gsf Nov 20, 2025
c32bbd3
Add errors after groups in logs
gsf Nov 20, 2025
7af953d
Add log warning for changes planned
gsf Nov 21, 2025
5d81b3d
Run apply only on plan changes
gsf Nov 21, 2025
978fe60
Drop outputs to run summary
gsf Nov 21, 2025
419b821
Do not create sops wrapper by default
gsf Nov 21, 2025
9fd4848
Create policy doc for queue if docs set
gsf Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/python-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: python-checks

on:
push:
paths:
- terraform/services/alarm-to-slack/lambda_src/**
workflow_dispatch:

jobs:
python-checks:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- run: scripts/python-checks
9 changes: 0 additions & 9 deletions .github/workflows/tf-admin-aco-deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ defaults:
working-directory: ./terraform/services/admin-aco-deny

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-admin-create-aco-creds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ defaults:
working-directory: ./terraform/services/admin-create-aco-creds

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-admin-create-aco.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ defaults:
working-directory: ./terraform/services/admin-create-aco

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-admin-create-group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ defaults:
working-directory: ./terraform/services/admin-create-group

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/tf-alarm-to-slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,7 @@ defaults:
working-directory: ./terraform/services/alarm-to-slack

jobs:
python-lint-test:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- name: Install Python dependencies & Run Lint and Unit Tests
run: |
pip install pylint pytest
pylint lambda_src
pytest lambda_src

check-fmt:
needs: python-lint-test
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply-deploy:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-api-waf-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ defaults:
working-directory: ./terraform/services/api-waf-sync

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-api-waf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ defaults:
working-directory: ./terraform/services/api-waf

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-backup-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ defaults:
working-directory: ./terraform/services/backup-plan

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-bucket-access-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,7 @@ defaults:
working-directory: ./terraform/services/bucket-access-logs

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-cclf-import.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ defaults:
working-directory: ./terraform/services/cclf-import

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-codebuild-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ defaults:
working-directory: ./terraform/services/codebuild-projects

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-external-services-ip-sets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,7 @@ defaults:
working-directory: ./terraform/services/external-services-ip-sets

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-github-actions-oidc-provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ defaults:
working-directory: ./terraform/services/github-actions-oidc-provider

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-github-actions-role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,7 @@ defaults:
working-directory: ./terraform/services/github-actions-role

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-kms-keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ defaults:
working-directory: ./terraform/services/kms-keys

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-opt-out-export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ defaults:
working-directory: ./terraform/services/opt-out-export

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-opt-out-import.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ defaults:
working-directory: ./terraform/services/opt-out-import

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/tf-security-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,10 @@ env:

defaults:
run:
working-directory: ./terraform/services/security-groups
working-directory: ./terraform/services/security-groups

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-snyk-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ defaults:
working-directory: ./terraform/services/snyk-integration

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/tf-tfstate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@ defaults:
working-directory: ./terraform/services/tfstate

jobs:
check-fmt:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@v4
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: tofu fmt -check -diff -recursive .

plan-apply:
needs: check-fmt
permissions:
contents: read
id-token: write
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/tofu-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: tofu-checks

on:
workflow_dispatch:
pull_request:
paths:
- 'terraform/**'
push:
branches:
- main
paths:
- 'terraform/**'

env:
TENV_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
check:
runs-on: codebuild-cdap-${{github.run_id}}-${{github.run_attempt}}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why fetch-depth: 0 instead of 1? Does zero fetch everything?

Copy link
Member

@gsf gsf Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've dropped the need for commit comparison in this file but see python-checks for a place where I leverage tj-actions/changed-files to run tests on changed directories only.

- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
- run: scripts/tofu-checks
Loading
Loading