Hello Community,
I’m running into an issue while creating GCP essential contacts using terraform.
Below code creates an contact in the project:
variable "project" {
description = "GCP project ID."
type = string
}
variable "essential-contact" {
description = "Value for Product Owner essential contact"
type = string
default = "abc@xyz.com"
}
resource "google_essential_contacts_contact" "contact_test" {
parent = "projects/${var.project}"
email = var.essential-contact
language_tag = "en-US"
notification_category_subscriptions = ["ALL","SECURITY"]
}
However, problem starts when I try to deploy the contacts in different project.
It destroys the contacts from the project where it was created earlier and then creates it fresh in new project. This is weird behavior compared to all other modules I deploy using terraform.
Attached screenshot of the log from terraform plan stage:
Generally all the resources are at the project level. I don’t understand why essential contacts are not working as expected.
Really appreciate any guidance in this case.