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

Handling Data Sources in Upjet for Crossplane: Managing Dependencies #323

Closed
smileisak opened this issue Jan 7, 2024 · 4 comments
Closed
Labels
enhancement New feature or request

Comments

@smileisak
Copy link

What problem are you facing?

I am currently working on integrating the provider-ovh with Upjet for Crossplane and I've encountered a specific challenge related to managing data sources that are different from Terraform resources.

In Terraform, we have a data source ovh_cloud_project_capabilities_containerregistry_filter which is essential for generating the plan_id used in creating resources like ovh_cloud_project_containerregistry.

For instance, in Terraform, we fetch the plan_id like this:

data "ovh_cloud_project_capabilities_containerregistry_filter" "capability" {
  service_name = "XXXXXX"
  region       = "GRA"
  plan_name    = "SMALL"
}

resource "ovh_cloud_project_containerregistry" "my-registry" {
  service_name = data.ovh_cloud_project_capabilities_containerregistry_filter.regcap.service_name
  plan_id      = data.ovh_cloud_project_capabilities_containerregistry_filter.regcap.id
  region       = data.ovh_cloud_project_capabilities_containerregistry_filter.regcap.region
  name         = "mydockerregistry"
}

However, with Upjet, I am not clear on how to handle this scenario since the data source doesn't directly translate into Terraform resources. I am wondering how to manage a data source in Upjet where the resource configuration relies on data that is typically fetched from a Terraform data source.

How could Upjet help solve your problem?

I am looking for guidance or suggestions on how to approach this scenario within Upjet and Crossplane. Specifically, I would like to understand:

How can Upjet handle situations where a Crossplane resource depends on data typically fetched from a Terraform data source?
Are there recommended practices within Upjet for managing these types of dependencies, especially when the data source does not directly translate into a Crossplane resource?
Any insights or examples of handling similar scenarios would be greatly appreciated.

@smileisak smileisak added the enhancement New feature or request label Jan 7, 2024
@jeanduplessis jeanduplessis modified the milestones: 1.2, 1.3 Feb 3, 2024
@smileisak
Copy link
Author

any news on this ?

@tomasmota
Copy link
Contributor

tomasmota commented Mar 4, 2024

I'm having the exact same issue, would also appreciate some guidance on what patterns to use in this case. I have been trying to read the data source using a terraform workspace, but reading it from a composition has been challenging. Any suggestions @ulucinar , @jeanduplessis?

@ytsarev
Copy link
Member

ytsarev commented Mar 28, 2024

We have a couple of related examples in provider-terraform that can help to work around this problem. Both of them are operating within the Composition.

@jeanduplessis
Copy link
Collaborator

Unfortunately, unless XP introduces a native data source type to the XRM, it's not going to be feasible to solve this with Upjet. Workarounds like using provider-terraform and using composition are the only viable options until then.

@jeanduplessis jeanduplessis closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants