Closed ezgidemirel closed 1 year ago
Hello, I'd really like to be able to import an existing resource without having to fill all required fields. This is possible in other IaC tools like Terraform Datasource of ACK Adopted resources where only the fields that allows to retrieve the resource in an unambiguous way are required. The use case would be to use attributes of a resource that is note managed by Crossplane (could be legacy stuffs managed manually or by another IaC tool, or even someone else's Crossplane) in our resources.
For example, we have an EKS platform currently deployed using Terraform where our users are deploying all their applications. Unfortunately, when their application needs IAM authentication, there are currently creating an IAM role with an assume role policy that references the OIDC issuer URL of the EKS cluster that is known by Terraform because it manages the EKS resource. We'd like to remove this adhesion between the platform and the workload and allow our users to create their IAM roles through Kubernetes resources (juste like their Deployments). But for that we need to retrieve the OIDC issuer URL of the current cluster dynamically.
This is also relevant to Observe Only feature, which is currently in the design phase.
As part of that work, I believe we will need to enhance upjet to use terrraform import
instead of terraform apply --refresh-only
to fetch the resource state from external APIs. I hope this will fix this issue as well.
ObserveOnly is implemented in official providers as Alpha feature - so we can close this issue
What happened?
Tried to import an existing subnet resource in provider-jet-aws with following manifest:
cidrBlock
andvpcId
fields are required and need to be provided for schema validation. However, passing empty values to those resources causes the following error:Importing a subnet resource is possible by Terraform with only external-name info (please see here for more information). Therefore, the manifest above should work.
This use case is especially important for customers who will migrate from native providers to jet providers.
How can we reproduce it?
Create a subnet resource with the following manifest:
Delete the MR and try to import it with the first manifest.