Skip to content

Conversation

@liamcervante
Copy link
Contributor

There's a bit of an inconsistency in the way we handle references to objects that haven't been resolved. Resource and local references result in panics, the other references return dynamic values. This PR updates resources and locals so they behave in the same way as other references.

Note, that references to non-existent resources / locals still results in an error as this is checked separately. This isn't normally an issue in regular Terraform as you would have graph cycles if references were circular during regular execution. But, it is possible to assert values against incomplete plans in both terraform test and terraform console and this is where you would see panics. Users can try to check values that weren't included in the plan because of an error or partial targeting, and this would result in panics. After this PR, we'd see unknown values returned for these references which matches the behaviour of modules / outputs / inputs.

Fixes #37409

Target Release

1.13.1

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@liamcervante liamcervante requested a review from a team as a code owner August 25, 2025 10:54
@liamcervante liamcervante added the 1.13-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Aug 25, 2025
mildwonkey
mildwonkey previously approved these changes Aug 25, 2025
@liamcervante liamcervante merged commit f931bc4 into main Aug 26, 2025
7 checks passed
@liamcervante liamcervante deleted the liamcervante/37409 branch August 26, 2025 07:20
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.13-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terraform Crash: value for local was requested before it was provided

3 participants