Pipeline Wiring Workshop
This workshop takes the Terraform root from Lab 1 and wires it to a real GitHub Actions pipeline with OIDC cloud credentials.
Retrieval Prompts
- State the three jobs of the minimal capstone workflow.
- State the GitHub token claims that the cloud trust policy must constrain.
- State the difference between a preview environment and a staging cut-over.
- State what
permissions: id-token: writeenables. - State the condition under which
terraform applyis allowed to run.
Compare and Distinguish
Separate these pairs clearly:
- static cloud access key vs OIDC role assumption
- PR deploy (
pull_request) vs main deploy (pushtomain) needs:dependency vsif:conditional- a GitHub environment with protection rules vs a plain secret
Common Mistake Check
For each statement, identify the error:
- "My OIDC trust uses
sub: repo:org/capstone:*so any branch can deploy." - "I put
id-token: writeat the top of the workflow because it's easier." - "We run
terraform applyon every PR to see what it would do." - "Our preview environments have never been torn down and that's fine because none of them get traffic."
- "I'll commit the AWS access key to a repo secret; rotation handles it."
Mini Application
Produce all four, committed to your capstone repo:
.github/workflows/deploy.ymlthat runsbuild-teston every push/PR and runsdeployonly onpushtomain.- A working OIDC identity provider and role in your cloud, with trust constrained to
repo:<you>/<capstone>:ref:refs/heads/main. - A
plan-on-prjob (or step) that runsterraform planon every PR and posts the plan summary as a comment. - Either (a) a preview-env up/down pair of jobs keyed on
pull_requestevents, or (b) a staging promotion workflow with a GitHubenvironment: prodthat requires manual approval.
Evidence Check
This page is complete only if you can show:
- one PR whose preview URL (or staging URL) was reachable
- one merge to
mainthat produced a successfuldeployrun in Actions - zero long-lived cloud access keys in repo or org secrets
- a
terraform planposted as a comment on one PR
If your pipeline is green but depends on a static cloud key, the workshop is not done.