fix: Terraform encryption at rest error when upgrading to 1.12.2 #1617
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Ticket: INTMDB-1277
This issue came from HELP-52173 where customers are getting the following error when upgrading from
v1.11.0
tov1.12.3
.Root Cause:
Context:
secret_access_key
in the encryption at rest resource but provided therole_id
secret_access_key
is never returned by the API response so we added a logic in the TF resource that stores the value ofsecret_access_key
in the TF configuration file inside the state file.Issue: When upgrading from old framework to the new framework, the state file saves the empty

secret_access_key
string with the stateValueStateKnown
with the empty string instead of using theValueStateUnKnown
which is what is returned with the new framework.Fix: I updated the logic to update the value of
secret_access_key
in the state file only it is not empty.Testing
I tested the logic locally with and without the change and checked that the issue is gone.
I added a migration test to check that is possible to migrate from v1.11.0 to the latest release.
I checked that the test fails when running without the changes
and it is successful with my changes
Type of change:
Required Checklist:
Further comments