If you change the name of the connector in the resource configuration, the provider creates a new connector though TF says it should be updating in-place
The other problem is that after the change, the old connector still exists but is no longer managed by TF
Steps to Replicate:
- Apply the Connector configuration to create the Connector
#Connector
resource "confluent_connector" "connector" {
environment {
id = data.confluent_environment.env.id
}
kafka_cluster {
id = data.confluent_kafka_cluster.cluster.id
}
#Header can be set as a variable, if necessary
config_sensitive = {
"kafka.api.key" = "KEY"
"kafka.api.secret" = "SECRET"
"connection.password" = "password"
}
config_nonsensitive = {
"kafka.auth.mode" = "KAFKA_API_KEY"
"tasks.max" = "1"
"name" = "MicrosoftSqlServerSourceConnector_Test"
"connector.class" = "MicrosoftSqlServerSource"
"topic.prefix" = "test."
"connection.host" = "hostname"
"connection.port" = "1433"
"connection.user" = "sa"
"db.name" = "testDB"
"table.whitelist" = "table"
"table.types" = "TABLE"
"output.data.format" = "JSON"
}
}
- Update the name of the Connector in the configuration and re-apply
#Connector
resource "confluent_connector" "connector" {
environment {
id = data.confluent_environment.env.id
}
kafka_cluster {
id = data.confluent_kafka_cluster.cluster.id
}
#Header can be set as a variable, if necessary
config_sensitive = {
"kafka.api.key" = "KEY"
"kafka.api.secret" = "SECRET"
"connection.password" = "password"
}
config_nonsensitive = {
"kafka.auth.mode" = "KAFKA_API_KEY"
"tasks.max" = "1"
"name" = "MicrosoftSqlServerSourceConnector_Test_2"
"connector.class" = "MicrosoftSqlServerSource"
"topic.prefix" = "test."
"connection.host" = "hostname"
"connection.port" = "1433"
"connection.user" = "sa"
"db.name" = "testDB"
"table.whitelist" = "table"
"table.types" = "TABLE"
"output.data.format" = "JSON"
}
}
Output of the provider below, however as you can see it generated a new Connector with a new ID
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# confluent_connector.connector will be updated in-place
~ resource "confluent_connector" "connector" {
~ config_nonsensitive = {
~ "name" = "MicrosoftSqlServerSourceConnector_Test" -> "MicrosoftSqlServerSourceConnector_Test_2"
# (11 unchanged elements hidden)
}
id = "lcc-prj5pm"
# (2 unchanged attributes hidden)
# (2 unchanged blocks hidden)
}
confluent_connector.connector: Modifying... [id=lcc-prj5pm]
confluent_connector.connector: Modifications complete after 3s [id=lcc-zg6y7y]
If you change the name of the connector in the resource configuration, the provider creates a new connector though TF says it should be updating in-place
The other problem is that after the change, the old connector still exists but is no longer managed by TF
Steps to Replicate:
Output of the provider below, however as you can see it generated a new Connector with a new ID