Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize native schema.Schema.ConflictsWith in late-initialization configuration #197

Open
ulucinar opened this issue May 3, 2023 · 0 comments
Labels
Milestone

Comments

@ulucinar
Copy link
Collaborator

ulucinar commented May 3, 2023

What problem are you facing?

We intermittently need to do some late initialization configuration for Terraformed resources because the native Terraform provider we are using defines some mutually exclude configuration arguments, i.e., arguments in the Terraform resource configuration that you cannot specify together. Let's assume argument a & b are mutually exclusive in this regard and we've set a. If the external resource has b also set, then the upjet runtime late-initializes the corresponding managed resource field and upon the next reconciliation, the generated Terraform configuration has both a & b set and this configuration is rejected by Terraform.

Currently, we attack this category of issues by adding some manual resource configuration so that the late-initialization library skips initializing the mutually exclusive managed resource fields as determined by the Terraform native provider implementation. An example of such manual configuration is here.

How could Upjet help solve your problem?

The mutually exclusive arguments for a Terraform resource are exposed via the schema.Schema.ConflictsWith API in the native schema. We may utilize this information to automatically configure the upjet late-initialization library and prevent the runtime issues that necessitate manual resource configuration to be resolved. An example in the native schema is here and a recent issue in the corresponding managed resource is here.

The current implementation blocker here is that ConflictsWith is currently not available in the JSON (native) schema we are utilizing in upjet's code generation pipelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants