From d04bddcefc1cf31f801b56afa9c680f6d0a8a4a0 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 24 Sep 2021 20:52:54 +0000 Subject: [PATCH] Add service_account to google_cloudbuild_trigger (#5237) Signed-off-by: Modular Magician --- google/cloudbuild_trigger.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/google/cloudbuild_trigger.go b/google/cloudbuild_trigger.go index 4368fc421..f1d7c61b3 100644 --- a/google/cloudbuild_trigger.go +++ b/google/cloudbuild_trigger.go @@ -113,6 +113,12 @@ func GetCloudBuildTriggerApiObject(d TerraformResourceData, config *Config) (map } else if v, ok := d.GetOkExists("substitutions"); !isEmptyValue(reflect.ValueOf(substitutionsProp)) && (ok || !reflect.DeepEqual(v, substitutionsProp)) { obj["substitutions"] = substitutionsProp } + serviceAccountProp, err := expandCloudBuildTriggerServiceAccount(d.Get("service_account"), d, config) + if err != nil { + return nil, err + } else if v, ok := d.GetOkExists("service_account"); !isEmptyValue(reflect.ValueOf(serviceAccountProp)) && (ok || !reflect.DeepEqual(v, serviceAccountProp)) { + obj["serviceAccount"] = serviceAccountProp + } filenameProp, err := expandCloudBuildTriggerFilename(d.Get("filename"), d, config) if err != nil { return nil, err @@ -192,6 +198,10 @@ func expandCloudBuildTriggerSubstitutions(v interface{}, d TerraformResourceData return m, nil } +func expandCloudBuildTriggerServiceAccount(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} + func expandCloudBuildTriggerFilename(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil }