Pin Terraform to 1.16 in CI - #182
Merged
Merged
Conversation
1 task
Contributor
|
Terraform plan in terraform No changes. Your infrastructure matches the configuration.✅ Plan applied in Terraform apply (OIDC) #67 |
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.
Terraform was never actually pinned in CI.
#38asked forrequired_version = "~> 1.12.1"— three components, which fixes major and minor and allows patch. What landed in #109 was"~> 1.12", one component short, and a two-part~>constraint pins only the major: it means>= 1.12, < 2.0, so every 1.x satisfies it.The dflook plan/apply actions have no version input — they resolve the constraint and take the newest release that matches. From today's plan run:
terraform_versionrecorded in the state file,s3://hfla-incubator-terraform-state:It has never run a 1.12.x under the constraint — 1.13 was already out when #109 merged.
Pinning forward to 1.16 rather than back to 1.12. State serial 140 was written by 1.16.0, and Terraform refuses to load a snapshot created by a newer version, so
~> 1.12.1today would fail every plan and apply outright. 1.16 is what is already deployed; #38's intent is recoverable, its version target is not.hackforla/devops-securityhas the same defect in a stronger form — norequired_versionat all — and gets the matching change in hackforla/devops-security#179.Verification
Switched to Terraform v1.16.xand succeeds. Confirmed:Switched to Terraform v1.16.0, plan green,No changes.Not in scope
terraform/backend.tfis notterraform fmtclean onmain(sourceandsuperuseralignment); left alone..terraform.lock.hclis gitignored, so provider versions float in CI too. Onlypostgresqlis pinned; theawsprovider has no constraint.