This creates the resource ok but in subsequent run the plan decides to replace the resource
# module.test_1.awscc_iot_domain_configuration.custom must be replaced
-/+ resource "awscc_iot_domain_configuration" "custom" {
~ arn = "arn:aws:iot:eu-central-1:XXXXXXX:domainconfiguration/test1-702/qysea" -> (known after apply)
+ authorizer_config = (known after apply)
~ domain_type = "CUSTOMER_MANAGED" -> (known after apply)
~ id = "test1-702" -> (known after apply)
~ server_certificates = [
- {
- server_certificate_arn = "arn:aws:acm:eu-central-1:XXXXXXXXX:certificate/3e948773-a577-4609-84d8-4e6a7ec06d0b" -> null
- server_certificate_status = "VALID" -> null
- server_certificate_status_detail = "Server Certificate is valid" -> null
},
] -> (known after apply)
~ tls_config = {
~ security_policy = "IoTSecurityPolicy_TLS13_1_2_2022_10" -> (known after apply)
} -> (known after apply)
+ validation_certificate_arn = (known after apply) # forces replacement
# (5 unchanged attributes hidden)
}
The validation_certificate_arn is a write only attribute and optional. We have set a lifecycle ignore_changes on this attribute but that has no impact.
Have you upgraded the awscc provider version since you last performed a plan on this configuration?
I suspect that with the current code, every awscc_iot_domain_configuration without an explicitly specified validation_certificate_arn will be destroyed and recreated on every plan.
Ah, OK. I’m pretty sure this is a bug in the provider code, then. It doesn’t seem to be able to cope with write-only attributes that can be optionally not specified, properly.