Skip to content

Conversation

SarahFrench
Copy link
Member

@SarahFrench SarahFrench commented Jun 17, 2025

Some prototyping/implementation for the PSS project that's only relevant to the apply command.

These changes enable saving PSS config in a plan, similar to how a planfile can store backend config and be used to configure a backend.Backend during an apply command that is supplied with a pre-existing plan file.

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 marked this pull request as ready for review June 18, 2025 17:21
@SarahFrench SarahFrench requested a review from a team as a code owner June 18, 2025 17:21
@SarahFrench SarahFrench requested a review from radeksimko June 18, 2025 17:21
Comment on lines 189 to 196
// TODO: Is this needed? Are there issues if the same provider is used for PSS and resource management also?
if p.StateStore.Provider != nil {
m[p.StateStore.Provider.Source.String()] = addrs.AbsProviderConfig{
Module: addrs.RootModule, // state_store block is only in Root
Provider: *p.StateStore.Provider.Source,
// No aliases used for PSS provider.
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This might benefit from some discussion/pair programming?

Copy link
Member

Choose a reason for hiding this comment

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

I agree - we should discuss this more thoroughly and talk through the consequences of our design choices here.

if plan.Backend.Type == "" || plan.Backend.Config == nil {
// Store details about accessing state
backendInUse := plan.Backend.Type != "" && plan.Backend.Config != nil
stateStoreInUse := plan.StateStore.Type != "" && plan.StateStore.Config != nil
Copy link
Member

Choose a reason for hiding this comment

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

I like the variable extraction here along with great names.

Comment on lines 189 to 196
// TODO: Is this needed? Are there issues if the same provider is used for PSS and resource management also?
if p.StateStore.Provider != nil {
m[p.StateStore.Provider.Source.String()] = addrs.AbsProviderConfig{
Module: addrs.RootModule, // state_store block is only in Root
Provider: *p.StateStore.Provider.Source,
// No aliases used for PSS provider.
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I agree - we should discuss this more thoroughly and talk through the consequences of our design choices here.

We may re-add this when we implement PSS for use during apply commands with plan files
@SarahFrench
Copy link
Member Author

Re this discussion topic

I agree - we should discuss this more thoroughly and talk through the consequences of our design choices here.

When we discussed this we agreed that we'd remove that code for now, as this method is only used in one place and the previous line that checks the config for needed providers will pull in entries from required_providers. As PSS requires an entry in required_providers, the provider necessary for PSS will already be identified.

We might re-assess this in future, but for now we opted to not include code that we didn't fully understand the ramifications of.

@SarahFrench SarahFrench requested a review from radeksimko June 27, 2025 18:27
@SarahFrench SarahFrench merged commit 2349481 into main Jun 30, 2025
8 checks passed
@SarahFrench SarahFrench deleted the pss/store-pss-in-planfile branch June 30, 2025 10:39
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 Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

2 participants