From 573da4d72929adfd7ed7c62fd277e7100cdb9661 Mon Sep 17 00:00:00 2001 From: Thomas Poindessous Date: Thu, 20 Apr 2017 12:12:43 +0200 Subject: [PATCH] Added a new attribute : source_disk_link --- builtin/providers/google/resource_compute_snapshot.go | 9 +++++++-- .../providers/google/r/compute_snapshot.html.markdown | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/builtin/providers/google/resource_compute_snapshot.go b/builtin/providers/google/resource_compute_snapshot.go index e8a4df452..e482c86f9 100644 --- a/builtin/providers/google/resource_compute_snapshot.go +++ b/builtin/providers/google/resource_compute_snapshot.go @@ -59,6 +59,11 @@ func resourceComputeSnapshot() *schema.Resource { ForceNew: true, }, + "source_disk_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "project": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -137,6 +142,8 @@ func resourceComputeSnapshotRead(d *schema.ResourceData, meta interface{}) error } d.Set("self_link", snapshot.SelfLink) + d.Set("source_disk_link", snapshot.SourceDisk) + d.Set("name", snapshot.Name) if snapshot.SnapshotEncryptionKey != nil && snapshot.SnapshotEncryptionKey.Sha256 != "" { d.Set("snapshot_encryption_key_sha256", snapshot.SnapshotEncryptionKey.Sha256) @@ -146,8 +153,6 @@ func resourceComputeSnapshotRead(d *schema.ResourceData, meta interface{}) error d.Set("source_disk_encryption_key_sha256", snapshot.SourceDiskEncryptionKey.Sha256) } - 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 d4d343df0..cdeb4fea9 100644 --- a/website/source/docs/providers/google/r/compute_snapshot.html.markdown +++ b/website/source/docs/providers/google/r/compute_snapshot.html.markdown @@ -29,7 +29,7 @@ The following arguments are supported: * `zone` - (Required) The zone where the source disk is located. -* `source_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. - - - @@ -61,4 +61,6 @@ exported: [customer-supplied encryption key](https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects the source disk. +* `source_disk_link` - The URI of the source disk. + * `self_link` - The URI of the created resource.