From 192684a7f6bcab74db3ff780dcd801137b2c5355 Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Fri, 12 Oct 2018 09:04:47 -0700 Subject: [PATCH] Removing create_timeout from compute image (#2244) --- google/resource_compute_image.go | 13 ++++--------- google/resource_compute_image_test.go | 5 +---- website/docs/r/compute_image.html.markdown | 2 -- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/google/resource_compute_image.go b/google/resource_compute_image.go index 4b541816..195bbf27 100644 --- a/google/resource_compute_image.go +++ b/google/resource_compute_image.go @@ -94,9 +94,9 @@ func resourceComputeImage() *schema.Resource { }, "create_timeout": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Deprecated: "Use timeouts block instead. See https://www.terraform.io/docs/configuration/resources.html#timeouts.", + Type: schema.TypeInt, + Optional: true, + Removed: "Use timeouts block instead. See https://www.terraform.io/docs/configuration/resources.html#timeouts.", }, "labels": &schema.Schema{ @@ -172,12 +172,7 @@ func resourceComputeImageCreate(d *schema.ResourceData, meta interface{}) error } // Read create timeout - var createTimeout int - if v, ok := d.GetOk("create_timeout"); ok { - createTimeout = v.(int) - } else { - createTimeout = int(d.Timeout(schema.TimeoutCreate).Minutes()) - } + createTimeout := int(d.Timeout(schema.TimeoutCreate).Minutes()) // Insert the image op, err := config.clientCompute.Images.Insert( diff --git a/google/resource_compute_image_test.go b/google/resource_compute_image_test.go index b6899b40..66fe34c1 100644 --- a/google/resource_compute_image_test.go +++ b/google/resource_compute_image_test.go @@ -100,7 +100,7 @@ func TestAccComputeImage_update(t *testing.T) { ResourceName: "google_compute_image.foobar", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"raw_disk", "create_timeout"}, + ImportStateVerifyIgnore: []string{"raw_disk"}, }, }, }) @@ -274,7 +274,6 @@ resource "google_compute_image" "foobar" { raw_disk { source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz" } - create_timeout = 5 labels = { my-label = "my-label-value" empty-label = "" @@ -291,7 +290,6 @@ resource "google_compute_image" "foobar" { raw_disk { source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz" } - create_timeout = 5 labels = { my-label = "my-label-value" empty-label = "" @@ -311,7 +309,6 @@ resource "google_compute_image" "foobar" { raw_disk { source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz" } - create_timeout = 5 labels = { empty-label = "oh-look-theres-a-label-now" new-field = "only-shows-up-when-updated" diff --git a/website/docs/r/compute_image.html.markdown b/website/docs/r/compute_image.html.markdown index 0e5b45a8..495b5c75 100644 --- a/website/docs/r/compute_image.html.markdown +++ b/website/docs/r/compute_image.html.markdown @@ -74,8 +74,6 @@ The following arguments are supported: (Note that one of either source_disk or * `licenses` - (Optional) A list of license URIs to apply to this image. Changing this forces a new resource to be created. -* `create_timeout` - (Deprecated) Configurable timeout in minutes for creating images. Default is 4 minutes. - The `raw_disk` block supports: * `source` - (Required) The full Google Cloud Storage URL where the disk