I have a resource that looks like this. The k8s manifest was manually applied. When I try to import the state into my state file I receive an error. I’ve looks through the documentation and I don’t see anything on how to import custom k8s resource (kind: Connector) in this case.
What is the ID to use for importing custom k8s resources?
Says: ID must contain apiVersion, kind, and name. Those are named as follows, from the manitest:
apiversion: platform.confluent.io/v1beta1
kind: Connector
name: rt-cmt-adls-g2-sink-connector
resource "kubernetes_manifest" "connect" {
#convert the list of objects to a list of maps, where the map key is the connector name and the value is the connector object variable
for_each = {
for connector in var.connectors_to_deploy : connector.name => connector
}
manifest = yamldecode(file(each.value.path))
field_manager {
# force field manager conflicts to be overridden
force_conflicts = true
}
}
[17:43:48] connectors $ terraform import -var-file="azurerm.tfvars" -var-file="connector-deployments.tfvars" -var-file="kube.tfvars" kubernetes_manifest.connect[\"realtime-compliance-adlsg2\"] platform.confluent.io/v1beta1/Connector/rt-cmt-adls-g2-sink-connector
Acquiring state lock. This may take a few moments...
data.terraform_remote_state.state: Reading...
kubernetes_manifest.connect["realtime-compliance-adlsg2"]: Importing from ID "platform.confluent.io/v1beta1/Connector/rt-cmt-adls-g2-sink-connector"...
data.terraform_remote_state.state: Read complete after 1s
╷
│ Error: Failed to parse import ID
│ could not parse ID: "platform.confluent.io/v1beta1/Connector/rt-cmt-adls-g2-sink-connector". ID must contain apiVersion, kind, and name
│ Error: Failed to get namespacing requirement from RESTMapper
│ no matches for kind "" in version ""