Skip to content

Commit

Permalink
address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alexott committed Dec 30, 2022
1 parent 4258d78 commit 4cd0213
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions common/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ func DataResource(sc any, read func(context.Context, any, *DatabricksClient) err
diags = diag.FromErr(err)
}
StructToData(ptr.Elem().Interface(), s, d)
// check if the resource schema has the `id` attribute (marked with `json:"id"` in the provided structure).
// and if yes, then use it as resource ID. If not, then use default value for resource ID (`_`)
if _, ok := s["id"]; ok {
d.SetId(d.Get("id").(string))
} else {
Expand Down
1 change: 0 additions & 1 deletion docs/data-sources/service_principal.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Data source allows you to pick service principals by the following attributes
Data source exposes the following attributes:

- `id` - The id of the service principal.
- `sp_id` - The id of the service principal (deprecated, kept for compatibility with earlier versions).
- `external_id` - ID of the service principal in an external identity provider.
- `display_name` - Display name of the [service principal](../resources/service_principal.md), e.g. `Foo SPN`.
- `home` - Home folder of the [service principal](../resources/service_principal.md), e.g. `/Users/11111111-2222-3333-4444-555666777888`.
Expand Down

0 comments on commit 4cd0213

Please sign in to comment.