Closed muvaf closed 2 years ago
cc @ulucinar I think we need to be able to do this in order to make some Azure resources we discussed more XRM-compliant. Essentially, a config interface that will say move subnets field from spec of VirtualNetwork to status
With https://github.com/crossplane-contrib/terrajet/pull/128 we now have access to TF schema in config object so we can do this operation.
What problem are you facing?
There are some APIs that allow you to manage the same object in two different APIs, for example you can manage
NodeGroup
through its API but also in an array underCluster
object. Per our Managed Resources API Design, we make the decision that in such cases, we'd choose to represent the resource only in one way and that would be a separate resource.It seems like Terraform community also tries to follow this pattern but there are cases where they didn't do that in the past and now they can't change the interface. So, what they do for such resources is to show a warning, encouraging to use the separate API.
How could Terrajet help solve your problem?
Since we don't have a strong contract yet, we can omit those fields from schema before generation, i.e. remove
nodeGroups
field fromcluster
object. We can do that easily by manipulating the TF schema we give to CRD generator but we need to make sure it works well across the board by testing it manually and adding the instructions to the guide that is to be written.