-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(secure-onboarding) Fix resource update operation
The TF provider’s knowledge of cloud account object is older and different from the actual BE cloud account. This is because BE has modified the account object with fields like organization_id during org onboarding. Hence, during intended PUTs, TF overwrites these fields resulting in unexpected state. Fix summary: ------------ 1. Add and expose the organization_id in provider's account resource schema (as a computed field only). This is to let the customers know if their onboarded account is part of any org when they fetch the real existing infrastructure objects using GET calls. 2. During resource updates (PUT API calls) restrict and reject with error when the customer tries to update any non-updatable resource fields. 3. Minor refactoring for cleaner code. Testing done: --------------- Validated the scenarios :- - During tf apply again --> it returns and updates organization_id on the account. - No unnecessary PUTs - On triggering an intended PUT :- - restricts any non-updatable fields - PUT works as expected, doesn't oevrwrite organization_id to ""
- Loading branch information
1 parent
eebe2b6
commit 3ed0614
Showing
3 changed files
with
78 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters