Terraform import doesn't import all fields - particularly for service accounts, but it seems to affect other types too.
Here's an example for a service account.
I run terraform import confluentcloud_service_account.test_account 108949 which appears to import the resource successfully. But a subsequent terraform plan gives the following:
# confluentcloud_service_account.test_account must be replaced
-/+ resource "confluentcloud_service_account" "test_account" {
+ description = "Alice's test account" # forces replacement
~ id = "108949" -> (known after apply)
+ name = "alice-test-account" # forces replacement
}
If you look at the data in the tfstate file, both description and name are null. If I manually edit the tfstate file to correct these fields then all is well, but I shouldn't have to do that.
Additionally, whilst changing the name is correctly forcing a replacement, it should be possible to change the description without forcing a replacement. Though this is perhaps best raised as a separate issue.
Terraform import doesn't import all fields - particularly for service accounts, but it seems to affect other types too.
Here's an example for a service account.
I run
terraform import confluentcloud_service_account.test_account 108949
which appears to import the resource successfully. But a subsequentterraform plan
gives the following:If you look at the data in the tfstate file, both description and name are null. If I manually edit the tfstate file to correct these fields then all is well, but I shouldn't have to do that.
Additionally, whilst changing the name is correctly forcing a replacement, it should be possible to change the description without forcing a replacement. Though this is perhaps best raised as a separate issue.