Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #125 from ulucinar/late-init-scenario
Browse files Browse the repository at this point in the history
Add late-initialization configuration use-cases
  • Loading branch information
ulucinar authored Oct 22, 2021
2 parents 412cc96 + 70e44d4 commit 484695d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/adding-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,20 @@ As an example if you would like to ignore `DelegationParameters.Name`
fields during late-initialization, the relative name to be used is:
`Delegation.Name`.
In most cases, custom late-initialization configuration will not be necessary. However,
after generating a new managed resource and observing its behaviour (at runtime),
it may turn out that late-initialization behaviour needs customization. For certain
resources like the `provider-tf-azure`'s `PostgresqlServer` resource, we have
observed that Terraform state contains values for mutually exclusive parameters, e.g.,
for `PostgresqlServer`, both `StorageMb` and `StorageProfile[].StorageMb` get
late-initialized. Upon next reconciliation, we generate values for both parameters in the
Terraform configuration, and although they happen to have the same value, Terraform
configuration validation requires them to be mutually exclusive. Currently, we observe
this behaviour at runtime, and upon observing that the resource cannot transition to the
`Ready` state and acquires the Terraform validation error message in its `status.conditions`,
we do the `LateInitializer.IgnoreFields` custom configuration detailed above to skip
one of the mutually exclusive fields during late-initialization.

[comment]: <> (References)

[Terrajet]: https://github.com/crossplane-contrib/terrajet
Expand Down

0 comments on commit 484695d

Please sign in to comment.