Skip to content

Commit 184fcbd

Browse files
add timeouts (#5114) (#3578)
* add timeouts * update the default length of timeout Signed-off-by: Modular Magician <[email protected]>
1 parent 9b5d0d8 commit 184fcbd

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

.changelog/5114.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
storage: added support for timeouts on `google_storage_bucket_object`
3+
```

google-beta/resource_gke_hub_feature_membership_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"testing"
77

8-
dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
8+
"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
99
gkehub "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/gkehub/beta"
1010
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"

google-beta/resource_storage_bucket_object.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"log"
88
"os"
99
"strings"
10+
"time"
1011

1112
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1213

@@ -27,6 +28,12 @@ func resourceStorageBucketObject() *schema.Resource {
2728
Update: resourceStorageBucketObjectUpdate,
2829
Delete: resourceStorageBucketObjectDelete,
2930

31+
Timeouts: &schema.ResourceTimeout{
32+
Create: schema.DefaultTimeout(4 * time.Minute),
33+
Update: schema.DefaultTimeout(4 * time.Minute),
34+
Delete: schema.DefaultTimeout(4 * time.Minute),
35+
},
36+
3037
Schema: map[string]*schema.Schema{
3138
"bucket": {
3239
Type: schema.TypeString,

website/docs/r/storage_bucket_object.html.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ exported:
9292

9393
* `media_link` - (Computed) A url reference to download this object.
9494

95+
## Timeouts
96+
97+
This resource provides the following
98+
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
99+
100+
- `create` - Default is 4 minutes.
101+
- `update` - Default is 4 minutes.
102+
- `delete` - Default is 4 minutes.
103+
95104
## Import
96105

97106
This resource does not support import.

0 commit comments

Comments
 (0)