Skip to content

Commit 9aded85

Browse files
authored
Merge pull request hashicorp#2158 from rileykarson/cloud-functions-event-trigger
Add event_trigger to cloud functions
2 parents c176d93 + 20e8c75 commit 9aded85

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/r/cloudfunctions_function.html.markdown

+19
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,36 @@ The following arguments are supported:
6464

6565
* `entry_point` - (Optional) Name of a JavaScript function that will be executed when the Google Cloud Function is triggered.
6666

67+
* `event_trigger` - (Optional) A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with `trigger_http`.
68+
6769
* `trigger_http` - (Optional) Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as `https_trigger_url`. Cannot be used with `trigger_bucket` and `trigger_topic`.
6870

6971
* `trigger_bucket` - (Optional) Google Cloud Storage bucket name. Every change in files in this bucket will trigger function execution. Cannot be used with `trigger_http` and `trigger_topic`.
72+
Deprecated. Use `event_trigger` instead.
7073

7174
* `trigger_topic` - (Optional) Name of Pub/Sub topic. Every message published in this topic will trigger function execution with message contents passed as input data. Cannot be used with `trigger_http` and `trigger_bucket`.
75+
Deprecated. Use `event_trigger` instead.
7276

7377
* `labels` - (Optional) A set of key/value label pairs to assign to the function.
7478

7579
* `environment_variables` - (Optional) A set of key/value environment variable pairs to assign to the function.
7680

7781
* `retry_on_failure` - (Optional) Whether the function should be retried on failure. This only applies to bucket and topic triggers, not HTTPS triggers.
82+
Deprecated. Use `event_trigger.failure_policy.retry` instead.
83+
84+
The `event_trigger` block supports:
85+
86+
* `event_type` - (Required) The type of event to observe. For example: `"providers/cloud.storage/eventTypes/object.change"`
87+
and `"providers/cloud.pubsub/eventTypes/topic.publish"`. See the documentation on [calling Cloud Functions](https://cloud.google.com/functions/docs/calling/)
88+
for a full reference. Only Cloud Storage and Cloud Pub/Sub triggers are supported at this time.
89+
90+
* `resource` - (Required) Required. The name of the resource from which to observe events, for example, `"myBucket"`
91+
92+
* `failure_policy` - (Optional) Specifies policy for failed executions. Structure is documented below.
93+
94+
The `failure_policy` block supports:
95+
96+
* `retry` - (Required) Whether the function should be retried on failure. Defaults to `false`.
7897

7998
## Attributes Reference
8099

0 commit comments

Comments
 (0)