Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated to plugin 1.10, added acceptance tests for groups and users. …
…Added support for default roles and a data source to fetch the default all_user roles via creating a dummy user. Changed environment variable to include databricks prefix and databricks_azure for the azure components. Restructured storage types to include separate dbfs and s3 list blocks.
- Loading branch information
1 parent
f298f5f
commit 764a87e
Showing
46 changed files
with
1,604 additions
and
818 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
TOKEN=<dbapitoken for int test> | ||
HOST=<host for integration test> | ||
ARM_CLIENT_ID=<enterprise app client id> | ||
ARM_CLIENT_SECRET=<enterprise app secret> | ||
ARM_TENANT_ID=<active directory tenant id> | ||
ARM_SUBSCRIPTION_ID=<subscription id in which the workspace is being built> | ||
DATABRICKS_TOKEN=<dbapitoken for int test> | ||
DATABRICKS_HOST=<host for integration test> | ||
DATABRICKS_AZURE_CLIENT_ID=<enterprise app client id> | ||
DATABRICKS_AZURE_CLIENT_SECRET=<enterprise app secret> | ||
DATABRICKS_AZURE_TENANT_ID=<active directory tenant id> | ||
DATABRICKS_AZURE_SUBSCRIPTION_ID=<subscription id in which the workspace is being built> | ||
TEST_MANAGED_RESOURCE_GROUP=<managed resource group id for integration testing> | ||
TEST_WORKSPACE_NAME=<workspace name for integration testing> | ||
TEST_RESOURCE_GROUP=<workspace resource group for integration testing> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package databricks | ||
|
||
import ( | ||
"github.com/databrickslabs/databricks-terraform/client/service" | ||
"github.com/hashicorp/terraform-plugin-sdk/helper/schema" | ||
) | ||
|
||
func dataSourceDefaultUserRoles() *schema.Resource { | ||
return &schema.Resource{ | ||
Read: func(d *schema.ResourceData, m interface{}) error { | ||
client := m.(service.DBApiClient) | ||
|
||
defaultRolesUserName := d.Get("default_username").(string) | ||
metaUser, err := client.Users().GetOrCreateDefaultMetaUser(defaultRolesUserName, defaultRolesUserName, true) | ||
if err != nil { | ||
return err | ||
} | ||
d.SetId(metaUser.ID) | ||
err = d.Set("default_username", metaUser.UserName) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
err = d.Set("roles", getListOfRoles(metaUser.Roles)) | ||
return err | ||
}, | ||
Schema: map[string]*schema.Schema{ | ||
"default_username": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
}, | ||
"roles": &schema.Schema{ | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{Type: schema.TypeString}, | ||
ForceNew: true, | ||
}, | ||
}, | ||
} | ||
} |
Oops, something went wrong.