Skip to content

Switch to S3 terraform backend#501

Merged
Alex-Welsh merged 4 commits intomainfrom
s3-tf-backend
Apr 9, 2026
Merged

Switch to S3 terraform backend#501
Alex-Welsh merged 4 commits intomainfrom
s3-tf-backend

Conversation

@Alex-Welsh
Copy link
Copy Markdown
Member

@Alex-Welsh Alex-Welsh commented Apr 8, 2026

This change is a work in progress. Please do not merge it before it's ready. We could end up with a horrible mess if we have competing state files. This should all work now

Recent changes to the free tier of terraform cloud mean we can't use it anymore. Switching to an S3-compatible object store instead.

TODO:

  • Ensure locking works Locking works!
  • Ensure old statefile is removed so we atomically switch statefile in terraform cloud has been locked
  • Apply same change to other repos (e.g. terraform-bastion)
  • Switch to tofu

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the GitHub provider to version 6.11.1 and migrates the Terraform state backend from Terraform Cloud to a Cloudflare R2 S3-compatible storage. Review feedback suggests correcting the indentation of the backend configuration and adding a required_version constraint to ensure compatibility with the use_lockfile feature, which is only available in recent versions of Terraform and OpenTofu.

@stackhpc-ci
Copy link
Copy Markdown
Contributor

stackhpc-ci commented Apr 8, 2026

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖success

Validation Output


Warning: Deprecated attribute

  on repositories.tf line 20, in resource "github_repository" "repositories":
  20:       has_downloads,

The attribute "has_downloads" is deprecated. Refer to the provider
documentation for details.
Success! The configuration is valid, but there were some validation warnings
as shown above.


Terraform Plan 📖success

Show Plan

undefined

Pusher: @Alex-Welsh, Action: pull_request, Working Directory: ``, Workflow: Terraform GitHub

@Alex-Welsh Alex-Welsh force-pushed the s3-tf-backend branch 4 times, most recently from 86ed633 to bf02d1f Compare April 8, 2026 15:28
@Alex-Welsh Alex-Welsh changed the title WIP: Switch to S3 terraform backend Switch to S3 terraform backend Apr 9, 2026
@Alex-Welsh Alex-Welsh marked this pull request as ready for review April 9, 2026 08:38
@Alex-Welsh Alex-Welsh requested a review from a team as a code owner April 9, 2026 08:38
@Alex-Welsh Alex-Welsh merged commit 35b44b9 into main Apr 9, 2026
4 checks passed
@Alex-Welsh Alex-Welsh deleted the s3-tf-backend branch April 9, 2026 08:49
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.

3 participants