From 3777aafde74960a1f883688ccb36fedf84efae6a Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 27 Aug 2021 15:48:22 -0500 Subject: [PATCH] add timeouts (#5114) (#9937) * add timeouts * update the default length of timeout Signed-off-by: Modular Magician --- .changelog/5114.txt | 3 +++ google/resource_storage_bucket_object.go | 7 +++++++ website/docs/r/storage_bucket_object.html.markdown | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 .changelog/5114.txt diff --git a/.changelog/5114.txt b/.changelog/5114.txt new file mode 100644 index 00000000000..92b053d5426 --- /dev/null +++ b/.changelog/5114.txt @@ -0,0 +1,3 @@ +```release-note:bug +storage: added support for timeouts on `google_storage_bucket_object` +``` diff --git a/google/resource_storage_bucket_object.go b/google/resource_storage_bucket_object.go index 7f4acbe775a..43145d66d2f 100644 --- a/google/resource_storage_bucket_object.go +++ b/google/resource_storage_bucket_object.go @@ -7,6 +7,7 @@ import ( "log" "os" "strings" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -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, diff --git a/website/docs/r/storage_bucket_object.html.markdown b/website/docs/r/storage_bucket_object.html.markdown index d7da59fb3df..d14956183c9 100644 --- a/website/docs/r/storage_bucket_object.html.markdown +++ b/website/docs/r/storage_bucket_object.html.markdown @@ -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.