[TF-38853] Validate provider versions in config match the lock file - #38829
Merged
Conversation
arunatibm
marked this pull request as ready for review
July 28, 2026 18:12
|
@tommyokeefe please assist w a review when core team has the capacity; thank you |
austinvalle
reviewed
Aug 4, 2026
Member
There was a problem hiding this comment.
Thanks for the PR @arunatibm 👋🏻 !
These changes are looking good, I just left some minor comments to consider 👍🏻
Contributor
Author
|
Addressed changes from the review. |
austinvalle
previously approved these changes
Aug 5, 2026
austinvalle
approved these changes
Aug 5, 2026
Open
3 tasks
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.
Description
Fixes issue TF-38853
For a Stack configuration, if there is a discrepancy between the provider version declared in the component configuration and the the version in the
.terraform.lock.hcl, the Stack will execute deployment runs. This is a problem since we have a split between the preferred version and the locked version and leads to confusion and inconsistency.What is desired is that when the configured version and locked version differ, an error diagnostic must be generated. This will allow the practitioner to inspect, decide and fix the provider versions and then recreate the lock before executing a deployment run.
To recreate this issue, edit the provider version in the configuration file but do not regenerate the lock file. Then create a stack with this configuration. The deployment run will complete successfully.
The bulk of the functional changes are in these files, and the remaining are to fix test inputs because the new validations will fail.
Testing
Created a mismatch between the lock and the configuration and ran
$ terraform stacks validateand we see the validation errors in the command response.Snippet of the configuration with the provider declarations
Snippet from the lock file
Target Release
Next upcoming minor release
1.17.x
Rollback Plan
Changes to Security Controls
N/A
CHANGELOG entry