Skip to content

Commit

Permalink
Merge pull request #6973 from lawrencegripper/lg/workspaceurl
Browse files Browse the repository at this point in the history
`azurerm_databricks_workspace`: Add workspace_id and url
  • Loading branch information
tombuildsstuff committed May 18, 2020
2 parents 44a9cfb + 852c954 commit 13bde54
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
Expand Up @@ -111,6 +111,16 @@ func resourceArmDatabricksWorkspace() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},

"workspace_url": {
Type: schema.TypeString,
Computed: true,
},

"workspace_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -231,6 +241,8 @@ func resourceArmDatabricksWorkspaceRead(d *schema.ResourceData, meta interface{}
d.Set("managed_resource_group_id", props.ManagedResourceGroupID)
d.Set("managed_resource_group_name", managedResourceGroupID.ResourceGroup)
d.Set("custom_parameters", flattenWorkspaceCustomParameters(props.Parameters))
d.Set("workspace_url", props.WorkspaceURL)
d.Set("workspace_id", props.WorkspaceID)
}

return tags.FlattenAndSet(d, resp.Tags)
Expand Down
Expand Up @@ -3,6 +3,7 @@ package tests
import (
"fmt"
"net/http"
"regexp"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
Expand Down Expand Up @@ -95,6 +96,8 @@ func TestAccAzureRMDatabricksWorkspace_basic(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMDatabricksWorkspaceExists(data.ResourceName),
resource.TestCheckResourceAttrSet(data.ResourceName, "managed_resource_group_id"),
resource.TestMatchResourceAttr(data.ResourceName, "workspace_url", regexp.MustCompile("azuredatabricks.net")),
resource.TestCheckResourceAttrSet(data.ResourceName, "workspace_id"),
),
},
data.ImportStep(),
Expand Down
6 changes: 5 additions & 1 deletion website/docs/r/databricks_workspace.html.markdown
Expand Up @@ -68,10 +68,14 @@ The following arguments are supported:

The following attributes are exported:

* `id` - The ID of the Databricks Workspace.
* `id` - The ID of the Databricks Workspace in the Azure management plane.

* `managed_resource_group_id` - The ID of the Managed Resource Group created by the Databricks Workspace.

* `workspace_url` - The workspace URL which is of the format 'adb-{workspaceId}.{random}.azuredatabricks.net'

* `workspace_id` - The unique identifier of the databricks workspace in Databricks control plane.

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
Expand Down

0 comments on commit 13bde54

Please sign in to comment.