Skip to content

Commit 58cbf86

Browse files
authored
Teams: resource_team Add UID to teams for reads (#1895)
* add UID to teams for read purposes * docs update
1 parent 8011ff4 commit 58cbf86

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

docs/data-sources/team.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ to the team. Note: users specified here must already exist in Grafana.
5252
- `team_sync` (List of Object) Sync external auth provider groups with this Grafana team. Only available in Grafana Enterprise.
5353
* [Official documentation](https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-team-sync/)
5454
* [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/team_sync/) (see [below for nested schema](#nestedatt--team_sync))
55+
- `team_uid` (String) The team uid assigned to this team by Grafana.
5556

5657
<a id="nestedatt--preferences"></a>
5758
### Nested Schema for `preferences`

docs/resources/team.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ to the team. Note: users specified here must already exist in Grafana.
5555

5656
- `id` (String) The ID of this resource.
5757
- `team_id` (Number) The team id assigned to this team by Grafana.
58+
- `team_uid` (String) The team uid assigned to this team by Grafana.
5859

5960
<a id="nestedblock--preferences"></a>
6061
### Nested Schema for `preferences`

internal/resources/grafana/resource_team.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ func resourceTeam() *common.Resource {
5555
Computed: true,
5656
Description: "The team id assigned to this team by Grafana.",
5757
},
58+
"team_uid": {
59+
Type: schema.TypeString,
60+
Computed: true,
61+
Description: "The team uid assigned to this team by Grafana.",
62+
},
5863
"name": {
5964
Type: schema.TypeString,
6065
Required: true,
@@ -234,6 +239,7 @@ func readTeamFromID(client *goapi.GrafanaHTTPAPI, teamID int64, d *schema.Resour
234239

235240
d.SetId(MakeOrgResourceID(team.OrgID, teamID))
236241
d.Set("team_id", teamID)
242+
d.Set("team_uid", team.UID)
237243
d.Set("name", team.Name)
238244
d.Set("org_id", strconv.FormatInt(team.OrgID, 10))
239245
if team.Email != "" {

0 commit comments

Comments
 (0)