opentofu/internal/backend/remote-state/gcs
Sarah French d43ec0f30f
Add customer-managed encryption key (KMS) support to GCS backend (#31786)
* Add ability to use customer-managed KMS key to encrypt state, add acceptance tests

* Change test names for different encrpytion methods

* Commit files updated by `go mod tidy`

* Add guard against missing ENVs to `setupKmsKey` func

* Update KMS setup function to get credentials from ENVs

* Update tests to not include zero-values in config

This means that default values are supplied later by TF instead of supplied as config from the user

This also avoids issues related to making field conflicts explicit with `ConflictsWith`

* Make `encryption_key` & `kms_encryption_key` conflicting fields

Removing the Default from `encryption_key` does not appear to be a breaking change when tested manually

* Add ability to set `kms_encryption_key` via ENV

* Refactor `encryption_key` to use `DefaultFunc` to access ENV, if set

* Remove comments

* Update `gcs` backend docs & descriptions in schema

* Update `gcs` backend docs to include information on encryption methods

* Apply technical writing suggestions from code review

Co-authored-by: Matthew Garrell <69917312+mgarrell777@users.noreply.github.com>

* Update documentation to remove passive voice

* Change use of context in tests, add inline comment, update logs

* Remove use of `ReadPathOrContents` for new field

Co-authored-by: Matthew Garrell <69917312+mgarrell777@users.noreply.github.com>
2022-10-04 10:10:49 +01:00
..
backend_state.go Add customer-managed encryption key (KMS) support to GCS backend (#31786) 2022-10-04 10:10:49 +01:00
backend_test.go Add customer-managed encryption key (KMS) support to GCS backend (#31786) 2022-10-04 10:10:49 +01:00
backend.go Add customer-managed encryption key (KMS) support to GCS backend (#31786) 2022-10-04 10:10:49 +01:00
client.go Add customer-managed encryption key (KMS) support to GCS backend (#31786) 2022-10-04 10:10:49 +01:00