Post the initial creation of the API credentials, any subsequent terraform apply resets the values of the certificates and secrets to null. This is occurs because the command btp get security/api-credential, does not return the secrets or the certificates of the created API credentials.
To address this, the Read function for each of the resources at all three levels (Subaccount, Directory and Globalaccount) have been modified to first retrieve the original values of the parameters (from the original state) before updating the state file. This change prevents the reset and ensures that the state file is consistent.
Does this introduce a breaking change?
[ ] Yes
[x] No
Pull Request Type
What kind of change does this Pull Request introduce?
[x] Bugfix
[ ] Feature
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:
How to Test
Test the code via automated test
go test ./...
What to Check
Verify that the following are valid:
Automated tests are executed successfully
Checklist for reviewer
The following organizational tasks must be completed before merging this PR:
[x] The PR is assigned to the Terraform project and a status is set (typically "in review").
[x] The PR has the matching labels assigned to it.
[x] The PR has a milestone assigned to it.
[x] If the PR closes an issue, the issue is referenced.
[x] Possible follow-up items are created and linked.
Purpose
fixes #949
Post the initial creation of the API credentials, any subsequent
terraform apply
resets the values of the certificates and secrets tonull
. This is occurs because the commandbtp get security/api-credential
, does not return the secrets or the certificates of the created API credentials.To address this, the
Read
function for each of the resources at all three levels (Subaccount, Directory and Globalaccount) have been modified to first retrieve the original values of the parameters (from the original state) before updating the state file. This change prevents the reset and ensures that the state file is consistent.Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
What to Check
Verify that the following are valid:
Checklist for reviewer
The following organizational tasks must be completed before merging this PR: