-
Notifications
You must be signed in to change notification settings - Fork 393
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
Added databricks_service_principal
and databricks_service_principals
data resources
#1370
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1370 +/- ##
==========================================
+ Coverage 90.10% 90.14% +0.04%
==========================================
Files 122 124 +2
Lines 10127 10172 +45
==========================================
+ Hits 9125 9170 +45
Misses 638 638
Partials 364 364
|
scim/data_service_principal.go
Outdated
} | ||
return common.DataResource(spnsData{}, func(ctx context.Context, e interface{}, c *common.DatabricksClient) error { | ||
response := e.(*spnsData) | ||
spnAPI := NewServicePrincipalsAPI(ctx, c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is useful for looking up spns either created outside of Terraform, or in another Terraform config - application_id or id are less friendly
@@ -71,6 +75,7 @@ func DataSourceUser() *schema.Resource { | |||
d.Set("home", fmt.Sprintf("/Users/%s", user.UserName)) | |||
d.Set("repos", fmt.Sprintf("/Repos/%s", user.UserName)) | |||
d.Set("external_id", user.ExternalID) | |||
d.Set("application_id", user.ApplicationID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if databricks_current_user is a Service Principal, return the application_id as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎊
databricks_service_principal
and databricks_service_principals
data resources
…ls` data resources (databricks#1370) * return `application_id` from `databricks_current_user` if that user is a Service Principal * add `databricks_service_principal` data source based on `application_id` * add `databricks_service_principals` data source based on `display_name` Co-authored-by: Ron DeFreitas <drax3d@gmail.com>
This continues and closes #1207
application_id
fromdatabricks_current_user
if that user is a Service Principaldatabricks_service_principal
data source based onapplication_id
databricks_service_principals
data source based ondisplay_name
Closes [FEATURE] Add data source for SPNs and identify if current user is a SPN #1208