Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UUID to space data source #378

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/data-sources/space.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ The following arguments are supported:

The following attributes are exported:

* `name` - The name of the Heroku Private Space. In Heroku, this is also the unique .
* `id` - The unique ID of the Heroku Private Space.
* `name` - The name of the Heroku Private Space.
* `id` - The space's name. (Heroku API supports using name and ID interchangeably, and this data source uses name for the resource ID.)
* `uuid` - The space's unique ID.
* `region` - The region in which the Heroku Private Space is deployed.
* `state` - The state of the Heroku Private Space. Either `allocating` or `allocated`.
* `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`.
Expand Down
6 changes: 6 additions & 0 deletions heroku/data_source_heroku_space.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ func dataSourceHerokuSpace() *schema.Resource {
Computed: true,
},

"uuid": {
Type: schema.TypeString,
Computed: true,
},

"cidr": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -72,6 +77,7 @@ func dataSourceHerokuSpaceRead(d *schema.ResourceData, m interface{}) error {
space := spaceRaw.(*spaceWithNAT)

d.SetId(name)
d.Set("uuid", space.ID)
d.Set("state", space.State)
d.Set("shield", space.Shield)

Expand Down