From e252640a94d7b97b259007ebfdb42f065b72e41c Mon Sep 17 00:00:00 2001 From: Daniel Schierbeck Date: Thu, 11 May 2017 14:30:06 +0200 Subject: [PATCH] Add a `url` attribute to `google_storage_bucket` (#14393) * Add a `url` attribute to `google_storage_bucket` * Document the `url` attribute --- builtin/providers/google/resource_storage_bucket.go | 6 ++++++ .../docs/providers/google/r/storage_bucket.html.markdown | 2 ++ 2 files changed, 8 insertions(+) diff --git a/builtin/providers/google/resource_storage_bucket.go b/builtin/providers/google/resource_storage_bucket.go index a5990c0fe..1d660324f 100644 --- a/builtin/providers/google/resource_storage_bucket.go +++ b/builtin/providers/google/resource_storage_bucket.go @@ -58,6 +58,11 @@ func resourceStorageBucket() *schema.Resource { Computed: true, }, + "url": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "storage_class": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -151,6 +156,7 @@ func resourceStorageBucketCreate(d *schema.ResourceData, meta interface{}) error // Assign the bucket ID as the resource ID d.Set("self_link", res.SelfLink) + d.Set("url", fmt.Sprintf("gs://%s", bucket)) d.SetId(res.Id) return nil diff --git a/website/source/docs/providers/google/r/storage_bucket.html.markdown b/website/source/docs/providers/google/r/storage_bucket.html.markdown index 08c9b9972..62ee40366 100644 --- a/website/source/docs/providers/google/r/storage_bucket.html.markdown +++ b/website/source/docs/providers/google/r/storage_bucket.html.markdown @@ -66,3 +66,5 @@ In addition to the arguments listed above, the following computed attributes are exported: * `self_link` - The URI of the created resource. + +* `url` - The base URL of the bucket, in the format `gs://`.