Custom state check configuration for TF plugin framework resources#515
Merged
sergenyalcin merged 2 commits intocrossplane:mainfrom Jul 28, 2025
Merged
Custom state check configuration for TF plugin framework resources#515sergenyalcin merged 2 commits intocrossplane:mainfrom
sergenyalcin merged 2 commits intocrossplane:mainfrom
Conversation
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
erhancagirici
approved these changes
Jul 28, 2025
Collaborator
erhancagirici
left a comment
There was a problem hiding this comment.
Thanks @sergenyalcin , overall looks good to me. I left a nit comment, which is not a blocker.
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 of your changes
We observed that a new region interceptor for the AWS TF Framework Plugin resources was introduced. This interceptor intervenes between API calls and the upjet fw controller and unconditionally injects the
regioninto the state.In the upjet fw controllers, we rely on the API request will return the uninterpreted state (the original form). If this state does not reflect the actual state, it will affect the decision-making processes of the upjet fw controller.
For example, in the
Observecall of the upjet fw controller, we decide whether a resource exists by checking whether the returned state is null. However, as pointed out, the interceptor always injects the region field. So, every null check will return false, which means that this check will not work correctly. Also, the TF plugin framework's internal decisions rely on performing checks based on whether the state is null or not.To handle this problem, we introduced a new configuration mechanism for framework resources. At this resource level, it will provide a generic structure for resolving this issue. The goal is to write custom state checks based on specific conditions at the provider and resource levels to determine whether the state is truly empty.
The main reasons for implementing this generically are to avoid moving provider—and resource-specific logic to upjet, to enable the creation of custom empty checkers at the resource level capable of handling the effects of different interceptors in specific situations, and to keep the scope of this change provider—and resource-specific.
I have:
make reviewableto ensure this PR is ready for review.backport release-x.ylabels to auto-backport this PR if necessary.How has this code been tested
Tested locally for a few TF plugin framework resources.