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

azurerm_databricks_workspace: Add workspace_id and url #6973

Merged
merged 2 commits into from May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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