Skip to content

Chore: install terraform in devcontainer - #3417

Merged
thekaveman merged 5 commits into
mainfrom
chore/devcontainer-terraform
Jan 14, 2026
Merged

Chore: install terraform in devcontainer#3417
thekaveman merged 5 commits into
mainfrom
chore/devcontainer-terraform

Conversation

@thekaveman

@thekaveman thekaveman commented Jan 12, 2026

Copy link
Copy Markdown
Member

Closes #3297

Reviewing

  1. Outside of the devcontainer, run bin/build.sh and confirm no errors
  2. Rebuild and Reopen the devcontainer, confirm this works as expected
  3. cd terraform/ then az login --tenant <DevSecOps tenant ID>
  4. ./init.sh dev to confirm the Terraform workspace is initialized and selected as expected
  5. Run terraform -help and confirm expected help output
  6. Make a small formatting change to a .tf file (e.g. add some extra space), save, confirm the auto-formatting removes your change

@thekaveman thekaveman self-assigned this Jan 12, 2026
@github-actions github-actions Bot added docker Application container, devcontainer, Compose, etc. infrastructure Terraform, Azure, etc. labels Jan 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@thekaveman thekaveman added the documentation [auto] Improvements or additions to documentation label Jan 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@thekaveman
thekaveman force-pushed the chore/devcontainer-terraform branch from 4df6f80 to 4328b0f Compare January 12, 2026 21:37
Comment thread .devcontainer/Dockerfile Outdated
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
tee /etc/apt/sources.list.d/hashicorp.list && \
apt update && \
apt install -y terraform

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not sure if there'd be an advantage to it in benefits, but i've used mise in the past as a terraform version manager too...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion @jgravois. I looked into mise and it just felt like a little bit more overhead than what is necessary here (at least for now... good to know more about that tooling though).

But I took your note and pinned the version of terraform that we install to match that in the terraform/deploy/pipeline.yml to minimize any potential version mismatch issues.

Also FWIW, Terraform's v1.x Compatibility Promises seem to indicate that we don't necessarily need to be concerned about this, but it certainly doesn't hurt to eliminate one more possible source of confusion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mise has a genuine upside in our other repos that use netlify to deploy because netlify uses it too.

in this repo I don't see any disadvantage to just installing the desired version of terraform explicitly and directly in a DevContainer as you're proposing.

regardless, thanks for tackling this 'quality of life' fix!

@thekaveman
thekaveman force-pushed the chore/devcontainer-terraform branch 2 times, most recently from 3ab94f4 to 345e30b Compare January 14, 2026 00:49
@thekaveman
thekaveman force-pushed the chore/devcontainer-terraform branch from 345e30b to 195fae4 Compare January 14, 2026 00:50
@thekaveman
thekaveman marked this pull request as ready for review January 14, 2026 00:54
@thekaveman
thekaveman requested a review from a team as a code owner January 14, 2026 00:54

@lalver1 lalver1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great! I also tested locally and everything worked as expected 👍

@thekaveman
thekaveman merged commit 9da54ad into main Jan 14, 2026
11 checks passed
@thekaveman
thekaveman deleted the chore/devcontainer-terraform branch January 14, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Application container, devcontainer, Compose, etc. documentation [auto] Improvements or additions to documentation infrastructure Terraform, Azure, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chore: install terraform in dev container and enable autoformatting

3 participants