Skip to content

Commit e4e425e

Browse files
authored
ExternalGroup: Fix import tfstate for external group (#846)
* WIP: test for external group * add: read teamid in externalgroup resource read * test to verify import is correct
1 parent 03304ff commit e4e425e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

internal/resources/grafana/resource_team_external_group.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func ReadTeamExternalGroup(ctx context.Context, d *schema.ResourceData, meta int
6767
for _, teamGroup := range teamGroups {
6868
groupIDs = append(groupIDs, teamGroup.GroupID)
6969
}
70+
d.Set("team_id", teamID)
7071
d.Set("groups", groupIDs)
7172

7273
return diag.Diagnostics{}

internal/resources/grafana/resource_team_external_group_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ func TestAccTeamExternalGroup_basic(t *testing.T) {
4141
),
4242
),
4343
},
44+
{
45+
ResourceName: "grafana_team_external_group.test",
46+
ImportState: true,
47+
ImportStateVerify: true,
48+
},
4449
},
4550
})
4651
}

0 commit comments

Comments
 (0)