Skip to content

Commit

Permalink
add timeouts (#5114) (#9937)
Browse files Browse the repository at this point in the history
* add timeouts

* update the default length of timeout

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Aug 27, 2021
1 parent 39dd0ed commit 3777aaf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/5114.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
storage: added support for timeouts on `google_storage_bucket_object`
```
7 changes: 7 additions & 0 deletions google/resource_storage_bucket_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"os"
"strings"
"time"

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

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

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(4 * time.Minute),
Update: schema.DefaultTimeout(4 * time.Minute),
Delete: schema.DefaultTimeout(4 * time.Minute),
},

Schema: map[string]*schema.Schema{
"bucket": {
Type: schema.TypeString,
Expand Down
9 changes: 9 additions & 0 deletions website/docs/r/storage_bucket_object.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ exported:

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

## Timeouts

This resource provides the following
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:

- `create` - Default is 4 minutes.
- `update` - Default is 4 minutes.
- `delete` - Default is 4 minutes.

## Import

This resource does not support import.

0 comments on commit 3777aaf

Please sign in to comment.