Skip to content

Conversation

@SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Nov 28, 2025

This PR is blocked by review of #37946, #37956, and #37957

Follows #37248

This PR adds validation to stop Terraform writing or using a planfile that has incomplete descriptions of the backend or state store configuration.

Target Release

N/A

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.

@SarahFrench SarahFrench added the no-changelog-needed Add this to your PR if the change does not require a changelog entry label Nov 28, 2025
@github-actions

This comment was marked as outdated.

@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from 94d4233 to 9a018e9 Compare November 28, 2025 12:25
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from 9a018e9 to d16ebe6 Compare November 28, 2025 12:47
@SarahFrench SarahFrench force-pushed the pss/validate-backend-state-store-config-in-plans branch from b44b360 to c6922ef Compare November 28, 2025 12:55
@SarahFrench SarahFrench force-pushed the pss/update-how-operations-use-backend-config-state branch from d16ebe6 to f795158 Compare November 28, 2025 16:16
This helps with navigating ambiguity around the word backend. The new name should indicate that the value represents a `backend` block, not a more general interpretation of what a backend is.
…to a lack of data. Don't change it if pluggable state storage is in use.
…ly isn't valid for `stateStoreConfigState` to be nil

I'm about 90% sure that backendConfigState being nil is ok <_<
… file with the expected state_store configuration data
…ng it to prepare a Local backend that uses the state store
…quired providers, if PSS is in use.

See the code comment added in this commit. This addition does not impact an apply command as the missing provider will be detected before this code is executed. However I'm making this change so that the method is still accurate is being able to return a complete list of providers needed by the plan.
…or state store config when getting a backend from a planfile
…Backend, so the planfile's Backend struct isn't flagged as empty.
…f a backend or state store is complete

The alternative approach would be to change the existing `Backend` field in the `Plan` struct to be a pointer. I'm open to either option, but the approach of using an `Empty` method matches existing work in the `workdir` package when inspecting the backend state file, and that seems a similar use-case to inspecting the plan file.
…e store is complete when reading or writing a plan file
@SarahFrench SarahFrench force-pushed the pss/validate-backend-state-store-config-in-plans branch from c6922ef to e3f20b8 Compare December 2, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed Add this to your PR if the change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant