confluentinc / terraform-provider-confluentcloud

Confluent Cloud Terraform Provider is deprecated in favor of Confluent Terraform Provider
https://registry.terraform.io/providers/confluentinc/confluentcloud/latest/docs
52 stars 23 forks source link

data references #36

Closed dehuszar closed 2 years ago

dehuszar commented 2 years ago

Hi there,

Are there plans for data references; as in:

data "confluentcloud_kafka_cluster" "cluster_from_another_stack" {
  display_name = "basic_kafka_cluster"
}

resource "confluentcloud_kafka_topic" "orders" {
  kafka_cluster      = data.confluentcloud_kafka_cluster.cluster_from_another_stack.id
  topic_name         = "orders"
  partitions_count   = 4
  http_endpoint      = data.confluentcloud_kafka_cluster.cluster_from_another_stack.http_endpoint
  config = {
    "cleanup.policy"    = "compact"
    "max.message.bytes" = "12345"
    "retention.ms"      = "67890"
  }
  credentials {
    key    = "<Kafka API Key for data.confluentcloud_kafka_cluster.cluster_from_another_stack>"
    secret = "<Kafka API Secret for data.confluentcloud_kafka_cluster.cluster_from_another_stack>"
  }
}

We would like to have a primary repo which controls all the core infrastructure, but not have to statically store all the requisite ids and pass them in to the producer and consumer services' stack.

linouk23 commented 2 years ago

Thanks for creating this issue @dehuszar!

I definitely agree that the support for data sources will be very useful and that's something we've been working on so hopefully we'll add them in one of our next releases, stay tuned!

linouk23 commented 2 years ago

👋 check out our most recent 0.4.0 release where we added data sources for:

dehuszar commented 2 years ago

Hooray! Thanks for the ping