confluentinc / terraform-provider-confluent

Terraform Provider for Confluent
Apache License 2.0
27 stars 63 forks source link

Upon mirror topic creation, have the option to not store credentials in the Terraform state file. #340

Open AdamBartal opened 9 months ago

AdamBartal commented 9 months ago

Just like with topic and schema creation, customer has asked if it could be possible to also have the option of NOT storing credentials in the TF state file when creating mirror topics.

Case 187643

Discussed in #terraform: https://confluent.slack.com/archives/C01880K2BAA/p1703872608176549?thread_ts=1703869169.969629&cid=C01880K2BAA

FireDrunk commented 6 months ago

We've hit this issue as well. This has more effect on other parts of the code as well.

The issue lies within this code: https://github.com/confluentinc/terraform-provider-confluent/blob/master/internal/provider/resource_kafka_mirror_topic.go#L95

It lacks the same logic as the regular topic: https://github.com/confluentinc/terraform-provider-confluent/blob/master/internal/provider/resource_kafka_topic.go#L153

The regular topic attempts to extract the configuration from either the Environment or the Resource, whereas the Mirror topic specifically requires it to be set in the Resource.