confluentinc / terraform-provider-confluent

Terraform Provider for Confluent
Apache License 2.0
31 stars 64 forks source link

Clean up created API keys if fails to "sync" #483

Open tarciosaraiva opened 2 weeks ago

tarciosaraiva commented 2 weeks ago

Recently we have been trying to solve a networking issue internally that allowed communication with one of our clusters. While we were troubleshooting we identified that the API keys were being created successfully in our cluster but were failing to be "sync'd" which seems to be a call to ListTopics from the provider.

This is the piece of code that seems to be executed and calls kafkaApiKeySyncStatus with a timeout of 20 minutes. That function in turn invokes ListKafkaTopics which seems to fail.

Our pipeline experienced the 20 minutes timeout and failed after with a context deadline exceeded error. However the API key crated was still there.

Once we fixed what was wrong with the networking connectivity we could get full flow happening but before that we had to enable the flag to disable_wait_for_ready as per the provider docs.

What I'd like to see is if there's a failure here then things should be cleaned up as I believe atomicity of the operation is better than leaving resources hanging about that are likely not going to be used.