-
Notifications
You must be signed in to change notification settings - Fork 10.1k
PSS: Add stateStoreInitFromConfig
method to Meta
, update savedStateStore
to include chunk size negotiation.
#37723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
// NOTE: the backend version of this method, `backendInitFromConfig`, prompts users for input if any required fields | ||
// are missing from the backend config. In `stateStoreInitFromConfig` we don't do this, and instead users will see an error. | ||
func (m *Meta) stateStoreInitFromConfig(c *configs.StateStore, factory providers.Factory) (backend.Backend, cty.Value, cty.Value, tfdiags.Diagnostics) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highlighting this - I this prompting users for input when required fields aren't set is an odd feature and I'm not sure if it's used much. Is this to help users who forget to set values via config or their environment, or is this a first-class feature that's used to pass values into Terraform?
I'm assuming it's a legacy-ish feature that we wouldn't choose to add now, so figured we exclude it to start and we can wait for feature requests in future.
…ides with state stores
… of accepting all BackendOpts This is to avoid confusion, e.g. unnecessary duplication of config being passed in.
525fe3b
to
eaf8717
Compare
…hunk size is negotiated
…rror if the provider doesn't return a chunk size > 0
…st to assert it's set
…sed in, add unhappy path tests
stateStoreInitFromConfig
method to Meta
stateStoreInitFromConfig
method to Meta
, update savedStateStore
to include chunk size negotiation.
This PR adds a new
stateStoreInitFromConfig
method that's similar to the existingbackendInitFromConfig
method onMeta
.The
stateStoreInitFromConfig
method added in this PR is used to get abackend.Backend
instance that uses pluggable state storage internally. The returned PSS is configured using the configuration in the TF project, in contrast to thesavedStateStore
method that does the same but uses backend state files for configuring the state store. These methods are both analogous tobackendInitFromConfig
andsavedBackend
.Additionally, this PR:
savedStateStore
and adds test coverage to that method.stateStoreConfig
.This PR is very similar to #37558, which implemented
savedStateStore
, a related method for getting a state store initialised using backend state, instead of config as we do here.Target Release
N/A
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry