Skip to content

Commit

Permalink
ExternalGroup: Fix import tfstate for external group (#846)
Browse files Browse the repository at this point in the history
* WIP: test for external group

* add: read teamid in externalgroup resource read

* test to verify import is correct
  • Loading branch information
eleijonmarck committed Mar 9, 2023
1 parent 03304ff commit e4e425e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/resources/grafana/resource_team_external_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func ReadTeamExternalGroup(ctx context.Context, d *schema.ResourceData, meta int
for _, teamGroup := range teamGroups {
groupIDs = append(groupIDs, teamGroup.GroupID)
}
d.Set("team_id", teamID)
d.Set("groups", groupIDs)

return diag.Diagnostics{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ func TestAccTeamExternalGroup_basic(t *testing.T) {
),
),
},
{
ResourceName: "grafana_team_external_group.test",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down

0 comments on commit e4e425e

Please sign in to comment.