From 5fcc6593cd14b6ad59e82f05414a038c55270cfa Mon Sep 17 00:00:00 2001 From: Thomas Poindessous Date: Mon, 27 Mar 2017 10:36:39 +0200 Subject: [PATCH] Review by @paddyforan: corrected documentation. Replaced disk by source_disk. Deleted sourcedisk_id --- .../google/resource_compute_snapshot.go | 16 ++-------------- .../google/r/compute_snapshot.html.markdown | 14 ++++---------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/builtin/providers/google/resource_compute_snapshot.go b/builtin/providers/google/resource_compute_snapshot.go index 9f5643a12..e8a4df452 100644 --- a/builtin/providers/google/resource_compute_snapshot.go +++ b/builtin/providers/google/resource_compute_snapshot.go @@ -53,17 +53,7 @@ func resourceComputeSnapshot() *schema.Resource { Computed: true, }, - "source_disk_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "source_disk": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "disk": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, @@ -96,7 +86,7 @@ func resourceComputeSnapshotCreate(d *schema.ResourceData, meta interface{}) err Name: d.Get("name").(string), } - disk := d.Get("disk").(string) + source_disk := d.Get("source_disk").(string) if v, ok := d.GetOk("snapshot_encryption_key_raw"); ok { snapshot.SnapshotEncryptionKey = &compute.CustomerEncryptionKey{} @@ -109,7 +99,7 @@ func resourceComputeSnapshotCreate(d *schema.ResourceData, meta interface{}) err } op, err := config.clientCompute.Disks.CreateSnapshot( - project, d.Get("zone").(string), disk, snapshot).Do() + project, d.Get("zone").(string), source_disk, snapshot).Do() if err != nil { return fmt.Errorf("Error creating snapshot: %s", err) } @@ -156,8 +146,6 @@ func resourceComputeSnapshotRead(d *schema.ResourceData, meta interface{}) error d.Set("source_disk_encryption_key_sha256", snapshot.SourceDiskEncryptionKey.Sha256) } - d.Set("source_disk_id", snapshot.SourceDiskId) - d.Set("source_disk", snapshot.SourceDisk) return nil diff --git a/website/source/docs/providers/google/r/compute_snapshot.html.markdown b/website/source/docs/providers/google/r/compute_snapshot.html.markdown index 96306d600..d4d343df0 100644 --- a/website/source/docs/providers/google/r/compute_snapshot.html.markdown +++ b/website/source/docs/providers/google/r/compute_snapshot.html.markdown @@ -15,7 +15,7 @@ Creates a new snapshot of a disk within GCE. ```js resource "google_compute_snapshot" "default" { name = "test-snapshot" - disk = "test-disk" + source_disk = "test-disk" zone = "us-central1-a" } ``` @@ -29,11 +29,11 @@ The following arguments are supported: * `zone` - (Required) The zone where the source disk is located. -* `disk` - (Required) The disk which will be used as the source of the snapshot +* `source_disk` - (Required) The disk which will be used as the source of the snapshot - - - -* `sourcedisk_encryption_key_raw` - (Optional) A 256-bit [customer-supplied encryption key] +* `source_disk_encryption_key_raw` - (Optional) A 256-bit [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption), encoded in [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4) to decrypt the source disk. @@ -56,15 +56,9 @@ exported: [customer-supplied encryption key](https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. -* `sourcedisk_encryption_key_sha256` - The [RFC 4648 base64] +* `source_disk_encryption_key_sha256` - The [RFC 4648 base64] (https://tools.ietf.org/html/rfc4648#section-4) encoded SHA-256 hash of the [customer-supplied encryption key](https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects the source disk. -* `sourcedisk_id` - The ID value of the source disk used to create this snapshot. - This value may be used to determine whether the snapshot was taken from the - current or a previous instance of a given disk name. - -* `sourcedisk` - The source disk used to create this snapshot. - * `self_link` - The URI of the created resource.