mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Accept all Cloud Storage and Cloud Pub/Sub event types
This commit is contained in:
parent
11129f13b8
commit
e5d8575541
@ -593,10 +593,10 @@ func expandEventTrigger(configured []interface{}, project string) *cloudfunction
|
|||||||
if data, ok := configured[0].(map[string]interface{}); ok {
|
if data, ok := configured[0].(map[string]interface{}); ok {
|
||||||
eventType := data["event_type"].(string)
|
eventType := data["event_type"].(string)
|
||||||
shape := ""
|
shape := ""
|
||||||
switch eventType {
|
switch {
|
||||||
case "providers/cloud.storage/eventTypes/object.change":
|
case strings.HasPrefix(eventType, "providers/cloud.storage/eventTypes/"):
|
||||||
shape = "projects/%s/buckets/%s"
|
shape = "projects/%s/buckets/%s"
|
||||||
case "providers/cloud.pubsub/eventTypes/topic.publish":
|
case strings.HasPrefix(eventType, "providers/cloud.pubsub/eventTypes/"):
|
||||||
shape = "projects/%s/topics/%s"
|
shape = "projects/%s/topics/%s"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,16 +84,16 @@ Deprecated. Use `event_trigger.failure_policy.retry` instead.
|
|||||||
The `event_trigger` block supports:
|
The `event_trigger` block supports:
|
||||||
|
|
||||||
* `event_type` - (Required) The type of event to observe. For example: `"providers/cloud.storage/eventTypes/object.change"`
|
* `event_type` - (Required) The type of event to observe. For example: `"providers/cloud.storage/eventTypes/object.change"`
|
||||||
and `"providers/cloud.pubsub/eventTypes/topic.publish"` Only `"providers/cloud.storage/eventTypes/object.change"` and
|
and `"providers/cloud.pubsub/eventTypes/topic.publish"`. See the documentation on [calling Cloud Functions](https://cloud.google.com/functions/docs/calling/)
|
||||||
`"providers/cloud.pubsub/eventTypes/topic.publish"` are supported at this time.
|
for a full reference. Only Cloud Storage and Cloud Pub/Sub triggers are supported at this time.
|
||||||
|
|
||||||
* `resource` - (Required) Required. The name of the resource from which to observe events, for example, `"myBucket"`
|
* `resource` - (Required) Required. The name of the resource from which to observe events, for example, `"myBucket"`
|
||||||
|
|
||||||
* `failure_policy` - (Required) Specifies policy for failed executions. Structure is documented below.
|
* `failure_policy` - (Optional) Specifies policy for failed executions. Structure is documented below.
|
||||||
|
|
||||||
The `failure_policy` block supports:
|
The `failure_policy` block supports:
|
||||||
|
|
||||||
* `retry` - (Optional) Whether the function should be retried on failure. Defaults to `false`.
|
* `retry` - (Required) Whether the function should be retried on failure. Defaults to `false`.
|
||||||
|
|
||||||
## Attributes Reference
|
## Attributes Reference
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user