Lab 4: state-account placeholder, deprecated azurerm attrs, macOS pip/venv - #4
Open
abdie-grcengineer wants to merge 1 commit into
Open
abdie-grcengineer wants to merge 1 commit into
abdie-grcengineer wants to merge 1 commit into
Conversation
…macOS pip/venv
Fixes found while running Lab 4 end to end on a fresh free subscription (macOS).
1. Step 2 (README) - state storage account placeholder in a runnable line.
The export line shipped the literal placeholder stgrctfstateXXXXXXXX, which a
copy-paste sends straight into a DNS lookup: plan fails with
"dial tcp: lookup stgrctfstateXXXXXXXX.blob.core.windows.net: no such host".
The variable has no default, so the value came from that line. Changed it to read
the value out of backend.hcl automatically (no manual substitution). The PR
description proposes a cleaner fix: derive the name in HCL and drop the variable.
2. Step 4 (README) - pip install is non-portable on macOS/Homebrew.
Verified on the machine: pip3 targets a different interpreter than the Homebrew
python3 that runs the script (ModuleNotFoundError: No module named 'azure'), and
python3 -m pip install is blocked by PEP 668. The labs warn Windows/Git Bash users
everywhere but have no macOS callout. Added a macOS / Homebrew callout box mirroring
the existing Windows ones, pointing at a venv.
3. stages/03-evidence-store/main.tf - two deprecated azurerm attributes (warnings today,
hard errors at azurerm v5.0):
- local_authentication_disabled = true -> local_authentication_enabled = false
(provider-stated rename; boolean inverts).
- azurerm_storage_container.reports.resource_manager_id -> .id
(resource_manager_id removed from the docs; id now returns the RM ID).
Unvalidated: could not run terraform plan in this repo (club-ops guard blocks it);
please confirm on apply.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Feedback from running Lab 4 (
labs/04-evidence) end to end on a fresh free subscription (macOS). All three are things that failed following the doc as written, not student mistakes. Suggestions only — merge, adjust, or close as you see fit.1. Step 2 — state-account placeholder in a runnable line → cryptic
no such hostThe step ships:
variables.tfgivesstate_storage_accountno default, so this line is the value source. Copied as-is (the pattern the whole lab trains),terraform planfails atdata.terraform_remote_state.foundation:Nothing points back to "you didn't substitute the placeholder." Same class as the Lab 1
you@example.complaceholder.This PR's change (doc-only, safe): replaced the placeholder line with one that reads the value out of
backend.hcl:Recommended deeper fix (not in this diff — your call): the name is deterministic (
bootstrap.sh=stgrctfstate+ first 8 chars of the sub ID), so the stage can derive it and drop the variable entirely. Inproviders.tf:Then delete the
state_storage_accountvariable (only referenced inproviders.tf:33) and the Step 2exportline — zero student action, no placeholder. Trade-off: naming rule then lives in two files. Alternative if you prefer one source of truth: havebootstrap.shalso write a*.auto.tfvars. I left this out of the diff because it's a design choice and I couldn't validate it withterraform plan(see note below).2. Step 4 —
pip installis non-portable; fails on macOS/HomebrewVerified on the machine:
pip3targets a different interpreter than the Homebrewpython3that runs the script (→ModuleNotFoundError: No module named 'azure'), andpython3 -m pip installis blocked by PEP 668 (externally-managed-environment). The labs warn Windows/Git Bash users at every friction point but have no macOS callout, so Mac students hit this blind.This PR's change: added a macOS / Homebrew callout box after the Step 4 command, mirroring the existing Windows/Git Bash boxes, pointing at a venv:
Inside a venv,
pipandpython3are the same interpreter and PEP 668 doesn't apply — identical on macOS, Linux, WSL.3.
stages/03-evidence-store/main.tf— two deprecated azurerm attributesWarnings today, hard errors once a student is on azurerm v5.0:
local_authentication_disabled = true→local_authentication_enabled = false(provider-stated rename; boolean inverts).azurerm_storage_container.reports.resource_manager_id→.id(verified:resource_manager_idis gone from the current docs;idnow returns the resource-manager ID this argument expects).This PR's change: applied both swaps, with explaining comments.
Scope
labs/04-evidence/README.md(Steps 2 + 4) andstages/03-evidence-store/main.tf.🤖 Generated with Claude Code