Skip to content
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

Group role member feature #101

Merged
merged 9 commits into from Jun 15, 2020
Merged

Group role member feature #101

merged 9 commits into from Jun 15, 2020

Conversation

stikkireddy
Copy link
Contributor

@stikkireddy stikkireddy commented Jun 15, 2020

Created three new resources with optional review for adding one more:

Resources:

Pushed & Tested:

  1. databricks_group (only supports display name with allow_cluster_create)
  2. databricks_group_role (1 to 1 mapping between instance profile and group)
  3. databricks_group_member (1 to 1 mapping between parent group [group_id] and member [group_id or user_id])

Optional & Up for Discussion:

  1. databricks_group_members (1 to all mappings between one parent group and all its members which will greatly reduce stress against SCIM api for patch requests to add members)

The purpose of the above resources are to manage groups only at the name & entitlement level.
The databricks_group only will include display name and entitlements to create or delete clusters.

Up for discussion to also move that outside of the group object because of the permissions api. I have flagged them as deprecated.

Example resource objects:

Creating member links:

resource "databricks_group" "my_group" {
  display_name = "%[1]s"
}
resource "databricks_group" "my_sub_group_a" {
  display_name = "sub_a_%[1]s"
}
resource "databricks_group" "my_sub_group_b" {
  display_name = "sub_b_%[1]s"
}
resource "databricks_group_member" "my_member_a" {
  group_id = databricks_group.my_group.id
  member_id = databricks_group.my_sub_group_a.id
}
resource "databricks_group_member" "my_member_b" {
  group_id = databricks_group.my_group.id
  member_id = databricks_group.my_sub_group_b.id
}

Creating Roles:

resource "databricks_instance_profile" "instance_profile" {
  instance_profile_arn = "%s"
  skip_validation = true
}
resource "databricks_group" "my_group" {
  display_name = "%s"
}
resource "databricks_group_role" "my_group_role" {
  group_id = databricks_group.my_group.id
  instance_profile_id = databricks_instance_profile.instance_profile.id
}

@stikkireddy stikkireddy requested a review from nfx June 15, 2020 10:24
"strings"
)

func resourceGroupRole() *schema.Resource {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this resource might have an alias - databricks_group_instance_profile :) because here we semantically mix two things and confuse outside user

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point, I always found this quite confusing as well... I will switch it to databricks_group_instance_profile

@stikkireddy stikkireddy merged commit 86f53be into master Jun 15, 2020
@stikkireddy stikkireddy deleted the group-role-member-feature branch July 16, 2020 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants