Skip to content

Commit 71017a4

Browse files
modular-magicianLawrence, Andrew
authored and
Lawrence, Andrew
committed
Remove google_cloudfunctions_function.retry_on_failure (hashicorp#2392)
1 parent 1aeeb34 commit 71017a4

File tree

2 files changed

+5
-28
lines changed

2 files changed

+5
-28
lines changed

google/resource_cloudfunctions_function.go

+5-25
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func resourceCloudFunctionsFunction() *schema.Resource {
207207
Type: schema.TypeList,
208208
Optional: true,
209209
Computed: true,
210-
ConflictsWith: []string{"trigger_http", "retry_on_failure", "trigger_topic", "trigger_http"},
210+
ConflictsWith: []string{"trigger_http"},
211211
MaxItems: 1,
212212
Elem: &schema.Resource{
213213
Schema: map[string]*schema.Schema{
@@ -245,11 +245,10 @@ func resourceCloudFunctionsFunction() *schema.Resource {
245245
},
246246

247247
"retry_on_failure": {
248-
Type: schema.TypeBool,
249-
Optional: true,
250-
Computed: true,
251-
Deprecated: "This field is deprecated. Use `event_trigger.failure_policy.retry` instead.",
252-
ConflictsWith: []string{"trigger_http"},
248+
Type: schema.TypeBool,
249+
Optional: true,
250+
Computed: true,
251+
Removed: "This field is removed. Use `event_trigger.failure_policy.retry` instead.",
253252
},
254253

255254
"project": {
@@ -404,12 +403,6 @@ func resourceCloudFunctionsRead(d *schema.ResourceData, meta interface{}) error
404403
}
405404

406405
d.Set("event_trigger", flattenEventTrigger(function.EventTrigger))
407-
if function.EventTrigger != nil {
408-
if _, ok := d.GetOk("retry_on_failure"); ok {
409-
retry := function.EventTrigger.FailurePolicy != nil && function.EventTrigger.FailurePolicy.Retry != nil
410-
d.Set("retry_on_failure", retry)
411-
}
412-
}
413406

414407
d.Set("region", cloudFuncId.Region)
415408
d.Set("project", cloudFuncId.Project)
@@ -476,19 +469,6 @@ func resourceCloudFunctionsUpdate(d *schema.ResourceData, meta interface{}) erro
476469
updateMaskArr = append(updateMaskArr, "environment_variables")
477470
}
478471

479-
// Event trigger will run after failure policy and take precedence
480-
if d.HasChange("retry_on_failure") {
481-
if d.Get("retry_on_failure").(bool) {
482-
if function.EventTrigger == nil {
483-
function.EventTrigger = &cloudfunctions.EventTrigger{}
484-
}
485-
function.EventTrigger.FailurePolicy = &cloudfunctions.FailurePolicy{
486-
Retry: &cloudfunctions.Retry{},
487-
}
488-
}
489-
updateMaskArr = append(updateMaskArr, "eventTrigger.failurePolicy.retry")
490-
}
491-
492472
if d.HasChange("event_trigger") {
493473
function.EventTrigger = expandEventTrigger(d.Get("event_trigger").([]interface{}), project)
494474
updateMaskArr = append(updateMaskArr, "eventTrigger", "eventTrigger.failurePolicy.retry")

website/docs/r/cloudfunctions_function.html.markdown

-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ The following arguments are supported:
7474

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

77-
* `retry_on_failure` - (Optional) Whether the function should be retried on failure. This only applies to bucket and topic triggers, not HTTPS triggers.
78-
Deprecated. Use `event_trigger.failure_policy.retry` instead.
79-
8077
The `event_trigger` block supports:
8178

8279
* `event_type` - (Required) The type of event to observe. For example: `"providers/cloud.storage/eventTypes/object.change"`

0 commit comments

Comments
 (0)