Add a `url` attribute to `google_storage_bucket` (#14393)

* Add a `url` attribute to `google_storage_bucket`

* Document the `url` attribute
This commit is contained in:
Daniel Schierbeck 2017-05-11 14:30:06 +02:00 committed by Paul Stack
parent e14dc3663f
commit e252640a94
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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://<bucket-name>`.