diff --git a/.changelog/4209.txt b/.changelog/4209.txt new file mode 100644 index 00000000000..188272db923 --- /dev/null +++ b/.changelog/4209.txt @@ -0,0 +1,3 @@ +```release-note:bug +cloudrun: added diff suppress function for `google_cloud_run_domain_mapping` `metadata.annotations` to ignore API-set fields +``` diff --git a/google/resource_cloud_run_domain_mapping.go b/google/resource_cloud_run_domain_mapping.go index 4b1bcb7e477..e23ee28c400 100644 --- a/google/resource_cloud_run_domain_mapping.go +++ b/google/resource_cloud_run_domain_mapping.go @@ -82,10 +82,11 @@ func resourceCloudRunDomainMapping() *schema.Resource { project ID or project number.`, }, "annotations": { - Type: schema.TypeMap, - Computed: true, - Optional: true, - ForceNew: true, + Type: schema.TypeMap, + Computed: true, + Optional: true, + ForceNew: true, + DiffSuppressFunc: cloudrunAnnotationDiffSuppress, Description: `Annotations is a key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations`, diff --git a/google/resource_cloud_run_domain_mapping_generated_test.go b/google/resource_cloud_run_domain_mapping_generated_test.go index f7764c3eb7e..f769e378207 100644 --- a/google/resource_cloud_run_domain_mapping_generated_test.go +++ b/google/resource_cloud_run_domain_mapping_generated_test.go @@ -78,6 +78,9 @@ resource "google_cloud_run_domain_mapping" "default" { metadata { namespace = "%{namespace}" + annotations = { + "run.googleapis.com/launch-stage" = "BETA" + } } spec { diff --git a/website/docs/r/cloud_run_domain_mapping.html.markdown b/website/docs/r/cloud_run_domain_mapping.html.markdown index 80a7ec934b2..9b1fceb5c8b 100644 --- a/website/docs/r/cloud_run_domain_mapping.html.markdown +++ b/website/docs/r/cloud_run_domain_mapping.html.markdown @@ -64,6 +64,9 @@ resource "google_cloud_run_domain_mapping" "default" { metadata { namespace = "my-project-name" + annotations = { + "run.googleapis.com/launch-stage" = "BETA" + } } spec {