From b32c5abe40f1b86a7eb2377eb3d2448b6e3c579e Mon Sep 17 00:00:00 2001 From: Dana Hoffman Date: Sat, 22 Dec 2018 01:35:53 +0000 Subject: [PATCH] add trigger_id to cloudbuild_build_trigger, send it on update --- google/resource_cloudbuild_build_trigger.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/google/resource_cloudbuild_build_trigger.go b/google/resource_cloudbuild_build_trigger.go index e79d41d355b..3af669fc7b1 100644 --- a/google/resource_cloudbuild_build_trigger.go +++ b/google/resource_cloudbuild_build_trigger.go @@ -135,6 +135,10 @@ func resourceCloudBuildTrigger() *schema.Resource { }, }, }, + "trigger_id": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -188,6 +192,7 @@ func resourceCloudbuildBuildTriggerRead(d *schema.ResourceData, meta interface{} d.Set("substitutions", buildTrigger.Substitutions) d.Set("ignored_files", buildTrigger.IgnoredFiles) d.Set("included_files", buildTrigger.IncludedFiles) + d.Set("trigger_id", buildTrigger.Id) if buildTrigger.TriggerTemplate != nil { d.Set("trigger_template", flattenCloudbuildBuildTriggerTemplate(d, config, buildTrigger.TriggerTemplate)) @@ -214,6 +219,7 @@ func resourceCloudbuildBuildTriggerUpdate(d *schema.ResourceData, meta interface if err != nil { return err } + buildTrigger.Id = d.Get("trigger_id").(string) id := d.Id()