-
Notifications
You must be signed in to change notification settings - Fork 10.1k
PSS: Add savedStateStore
method to Meta
#37558
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
Conversation
savedStateStore
method to Meta
03793cc
to
678807b
Compare
I've attempted to write a test that asserts marks are removed, but marks don't appear to be present at the time they're being removed. I assumed that this code that uses the schema (which contains Sensitive attributes) would result in a cty.Value that contains marks. Is there something wrong with my assumptions, or wrong with the code itself? |
…config from the backend state file
I sought some guidance about the question of whether marks are relevant here at all. From what I learned code in Terraform should only adds marks to config values that are used in the presentation layer, i.e. things that would be shown in the terminal output. They would be removed again when persisting to state, etc. I briefly implemented adding the marks (483f57a) but as there are no diagnostics that would log sensitive config values to the terminal those marks are not used anywhere. So I've updated the PR to no longer add the marks. In the code that uses the RPCs related to configuring providers and state stores we no longer have any code for removing marks as we now know that we're not adding any to those values, regardless of what the matching schema says about sensitivity etc. I've put a comment describing this to the code, as others might make our mistake of blindly assuming marks need to be removed before calling any RPC. |
Thanks! |
Description
This PR adds a new
savedStateStore
method that's similar to the existingsavedBackend
method onMeta
.The
savedBackend
method on Meta returns a backend that's configured using the backend state file's contents and isn't influenced by the current config. This method is used during state migration events ininit
commands, where Terraform needs to have an instance of the old backend, configured the old way, in order to access state to migrate to the new backend's location.Note: There is a variant called
backendFromState
that does a similar job but isn't considered in this PR. This variant is specific to users running init commands with-backend=false
as a flag.This PR adds a new
savedStateStore
method that's similar to the existingsavedBackend
method onMeta
. The method uses only backend state file data to configure and return a backend.Backend instance made using a provider that implements pluggable state storage.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