-
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_role
resource that grants service principals access to instance profiles
#1340
Conversation
return m | ||
}).BindResource(common.BindResource{ | ||
CreateContext: func(ctx context.Context, servicePrincipalID, role string, c *common.DatabricksClient) error { | ||
return scim.NewServicePrincipalsAPI(ctx, c).Patch(servicePrincipalID, scim.PatchRequest("add", "roles", role)) |
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 won't work as you expect, because servicePrincipalID
(int64) is not application_id
(uuid). BindResource
won't work for your use-case, unless you replace application_id
with service_principal_id
.
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.
Thank you @nfx! I changed the resource to accept service_principal_id
instead of application_id
, and role
instead of instance_profile_id
.
…stead of application_id Co-authored-by: Serge Smertin <259697+nfx@users.noreply.github.com>
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.
Minor consistency changes required
Codecov Report
@@ Coverage Diff @@
## master #1340 +/- ##
==========================================
- Coverage 90.60% 90.56% -0.04%
==========================================
Files 118 119 +1
Lines 10004 10021 +17
==========================================
+ Hits 9064 9076 +12
- Misses 559 564 +5
Partials 381 381
|
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_role
resource that grants service principals access to instance profiles
## 0.5.9 * Added warning section for debug mode ([#1325](#1325)). * Added ability to specify tags for `databricks_job` ([#1337](#1337)). * Upgraded AWS provider for AWS guides. Added examples for account-level identities ([#1332](#1332)). * Updated docs to use `application_id` as privilege for `databricks_service_principal` ([#1336](#1336)). * Added `databricks_service_principal_role` resource ([#1340](#1340)). * Fixed itegration testing image ([#1342](#1342), [#1343](#1343)). * Added `skip_validation` for `databricks_external_location` ([#1330](#1330)). * Added `alert_on_last_attempt` to `databricks_job` ([#1341](#1341)). * Skip `make test` on doc-only changes ([#1339](#1339)). * Improve common package test coverage ([#1344](#1344)). * Re-create purged cluster for `databricks_mount` for AWS S3 ([#1345](#1345)). Updated dependency versions: * Bump google.golang.org/api from 0.79.0 to 0.80.0 * Bump github.com/Azure/go-autorest/autorest/adal from 0.9.19 to 0.9.20
This PR adds a new resource `databricks_service_principal_role` that grants Databricks Service Principals access to Databricks Instance Profiles. At the moment, this has to be done as a manual step via the Databricks UI. Similar attachment/pairing resources already exist for Databricks users (`databricks_user_instance_profile` superseded by `databricks_user_role`) and groups (`databricks_group_instance_profile`).
This PR proposes to add a new resource
databricks_service_principal_role
that grants Databricks service principals access to Databricks instance profiles. At the moment, this has to be done as a manual step via the Databricks UI.Similar attachment/pairing resources already exist for Databricks users (
databricks_user_instance_profile
superseded bydatabricks_user_role
) and groups (databricks_group_instance_profile
).