shlogg · Early preview
Nomi3 @nomi3

Resolving Certificate Manager Error In Terraform With Google Cloud

Resolve Google Cloud Certificate Manager error: comment out referenced resources, update Terraform config, and reapply to change certificate domain.

This note describes how to address an error that occurred when trying to recreate a certificate in Google Cloud’s Certificate Manager, which is managed via Terraform.

Note
This operation was performed in a development environment, so downtime during the troubleshooting process was not considered.

  
  
  Versions

Terraform: 1.9.8
hashicorp/google: 6.16.0

  
  
  Goal

We wanted to change the domain in the certificate from before.com to after.com, as shown below:

locals {
-  domain_name = "before.com"
+  domain_name = "after.com"
}
resource "google_certificate_manager_dns_authorization" "e...