Skip to content

Commit 689b8e1

Browse files
Make the destination.cloud_function field on google_eventarc_trigger output only, update field description in docs (#9820) (#17052)
* Make the `destination.cloud_function` field on google_eventarc_trigger output only * Update description of `destination.cloud_function` field on google_eventarc_trigger * Add beta overrides to `google_eventarc_trigger` resource [upstream:ad8f182ac10f8c3537ef793f6f99b1053d153d7f] Signed-off-by: Modular Magician <[email protected]>
1 parent 14e5d8d commit 689b8e1

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.changelog/9820.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
eventarc: made the `destination.cloud_function` field on `google_eventarc_trigger` an output. Previously when users attempted to set this in their configuration it caused an API error.
3+
```

google/services/eventarc/resource_eventarc_trigger.go

+7-9
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,6 @@ func ResourceEventarcTrigger() *schema.Resource {
184184
func EventarcTriggerDestinationSchema() *schema.Resource {
185185
return &schema.Resource{
186186
Schema: map[string]*schema.Schema{
187-
"cloud_function": {
188-
Type: schema.TypeString,
189-
Optional: true,
190-
DiffSuppressFunc: tpgresource.CompareSelfLinkOrResourceName,
191-
Description: "[WARNING] Configuring a Cloud Function in Trigger is not supported as of today. The Cloud Function resource name. Format: projects/{project}/locations/{location}/functions/{function}",
192-
},
193-
194187
"cloud_run_service": {
195188
Type: schema.TypeList,
196189
Optional: true,
@@ -213,6 +206,12 @@ func EventarcTriggerDestinationSchema() *schema.Resource {
213206
DiffSuppressFunc: tpgresource.CompareSelfLinkOrResourceName,
214207
Description: "The resource name of the Workflow whose Executions are triggered by the events. The Workflow resource should be deployed in the same project as the trigger. Format: `projects/{project}/locations/{location}/workflows/{workflow}`",
215208
},
209+
210+
"cloud_function": {
211+
Type: schema.TypeString,
212+
Computed: true,
213+
Description: "The Cloud Function resource name. Only Cloud Functions V2 is supported. Format projects/{project}/locations/{location}/functions/{function} This is a read-only field. [WARNING] Creating Cloud Functions V2 triggers is only supported via the Cloud Functions product. An error will be returned if the user sets this value.",
214+
},
216215
},
217216
}
218217
}
@@ -620,7 +619,6 @@ func expandEventarcTriggerDestination(o interface{}) *eventarc.TriggerDestinatio
620619
}
621620
obj := objArr[0].(map[string]interface{})
622621
return &eventarc.TriggerDestination{
623-
CloudFunction: dcl.String(obj["cloud_function"].(string)),
624622
CloudRunService: expandEventarcTriggerDestinationCloudRunService(obj["cloud_run_service"]),
625623
Gke: expandEventarcTriggerDestinationGke(obj["gke"]),
626624
Workflow: dcl.String(obj["workflow"].(string)),
@@ -632,10 +630,10 @@ func flattenEventarcTriggerDestination(obj *eventarc.TriggerDestination) interfa
632630
return nil
633631
}
634632
transformed := map[string]interface{}{
635-
"cloud_function": obj.CloudFunction,
636633
"cloud_run_service": flattenEventarcTriggerDestinationCloudRunService(obj.CloudRunService),
637634
"gke": flattenEventarcTriggerDestinationGke(obj.Gke),
638635
"workflow": obj.Workflow,
636+
"cloud_function": obj.CloudFunction,
639637
}
640638

641639
return []interface{}{transformed}

website/docs/r/eventarc_trigger.html.markdown

+1-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ The following arguments are supported:
100100
The `destination` block supports:
101101

102102
* `cloud_function` -
103-
(Optional)
104-
[WARNING] Configuring a Cloud Function in Trigger is not supported as of today. The Cloud Function resource name. Format: projects/{project}/locations/{location}/functions/{function}
103+
The Cloud Function resource name. Only Cloud Functions V2 is supported. Format projects/{project}/locations/{location}/functions/{function} This is a read-only field. [WARNING] Creating Cloud Functions V2 triggers is only supported via the Cloud Functions product. An error will be returned if the user sets this value.
105104

106105
* `cloud_run_service` -
107106
(Optional)

0 commit comments

Comments
 (0)