Skip to content

Commit be0e791

Browse files
Add UUID to space data source (#378)
* Add UUID so it fetches the Space.ID * Update docs --------- Co-authored-by: Mars Hall <mars@users.noreply.github.com>
1 parent da2d6b9 commit be0e791

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs/data-sources/space.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ The following arguments are supported:
2929

3030
The following attributes are exported:
3131

32-
* `name` - The name of the Heroku Private Space. In Heroku, this is also the unique .
33-
* `id` - The unique ID of the Heroku Private Space.
32+
* `name` - The name of the Heroku Private Space.
33+
* `id` - The space's name. (Heroku API supports using name and ID interchangeably, and this data source uses name for the resource ID.)
34+
* `uuid` - The space's unique ID.
3435
* `region` - The region in which the Heroku Private Space is deployed.
3536
* `state` - The state of the Heroku Private Space. Either `allocating` or `allocated`.
3637
* `shield` - Whether or not the space has [Shield](https://devcenter.heroku.com/articles/private-spaces#shield-private-spaces) turned on. One of `on` or `off`.

heroku/data_source_heroku_space.go

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ func dataSourceHerokuSpace() *schema.Resource {
1818
Computed: true,
1919
},
2020

21+
"uuid": {
22+
Type: schema.TypeString,
23+
Computed: true,
24+
},
25+
2126
"cidr": {
2227
Type: schema.TypeString,
2328
Computed: true,
@@ -72,6 +77,7 @@ func dataSourceHerokuSpaceRead(d *schema.ResourceData, m interface{}) error {
7277
space := spaceRaw.(*spaceWithNAT)
7378

7479
d.SetId(name)
80+
d.Set("uuid", space.ID)
7581
d.Set("state", space.State)
7682
d.Set("shield", space.Shield)
7783

0 commit comments

Comments
 (0)