Skip to content

Commit

Permalink
Add a url attribute to google_storage_bucket (#14393)
Browse files Browse the repository at this point in the history
* Add a `url` attribute to `google_storage_bucket`

* Document the `url` attribute
  • Loading branch information
dasch authored and stack72 committed May 11, 2017
1 parent e14dc36 commit e252640
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builtin/providers/google/resource_storage_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>`.

0 comments on commit e252640

Please sign in to comment.