Skip to content

Commit f560623

Browse files
authored
Merge pull request #4 from tomarv2/develop
initial commit
2 parents 4dea565 + 48a9d71 commit f560623

File tree

7 files changed

+54
-3
lines changed

7 files changed

+54
-3
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
<img src="https://img.shields.io/github/commit-activity/m/tomarv2/terraform-databricks-azure-workspace" /></a>
1010
<a href="https://stackoverflow.com/users/6679867/tomarv2" alt="Stack Exchange reputation">
1111
<img src="https://img.shields.io/stackexchange/stackoverflow/r/6679867"></a>
12-
<a href="https://discord.gg/XH975bzN" alt="chat on Discord">
13-
<img src="https://img.shields.io/discord/813961944443912223?logo=discord"></a>
1412
<a href="https://twitter.com/intent/follow?screen_name=varuntomar2019" alt="follow on Twitter">
1513
<img src="https://img.shields.io/twitter/follow/varuntomar2019?style=social&logo=twitter"></a>
1614
</p>
-118 KB
Loading

examples/azure_databricks/outputs.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,19 @@ output "databricks_sku" {
2222
description = "The sku to use for the Databricks Workspace. Possible values are standard, premium, or trial. Changing this can force a new resource to be created in some circumstances"
2323
value = module.azure_databricks.databricks_sku
2424
}
25+
26+
output "sensitive_databricks_token" {
27+
description = "Value of the newly-created token"
28+
value = module.azure_databricks.databricks_token
29+
sensitive = true
30+
}
31+
32+
output "databricks_token" {
33+
description = "Value of the newly-created token (nonsensitive)"
34+
value = module.azure_databricks.nonsensitive_databricks_token
35+
}
36+
37+
output "databricks_token_lifetime_hours" {
38+
description = "Token validity"
39+
value = module.azure_databricks.databricks_token_lifetime_hours
40+
}

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ data "external" "current_user" {
55
program = ["az", "account", "show", "--query", "user"]
66
}
77

8+
data "databricks_current_user" "me" {
9+
depends_on = [azurerm_databricks_workspace.this]
10+
}
11+
812
module "resource_group" {
913
source = "git::[email protected]:tomarv2/terraform-azure-resource-group.git?ref=v0.0.3"
1014

outputs.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,19 @@ output "databricks_sku" {
2222
description = "The sku to use for the Databricks Workspace. Possible values are standard, premium, or trial. Changing this can force a new resource to be created in some circumstances"
2323
value = azurerm_databricks_workspace.this.sku
2424
}
25+
26+
output "databricks_token" {
27+
description = "Value of the newly-created token"
28+
value = databricks_token.pat.token_value
29+
sensitive = true
30+
}
31+
32+
output "nonsensitive_databricks_token" {
33+
description = "Value of the newly-created token"
34+
value = nonsensitive(databricks_token.pat.token_value)
35+
}
36+
37+
output "databricks_token_lifetime_hours" {
38+
description = "Token validity"
39+
value = databricks_token.pat.lifetime_seconds / 3600
40+
}

pat_token.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "databricks_token" "pat" {
2+
provider = databricks.created_workspace
3+
4+
comment = "Terraform managed: ${var.teamid}-${var.prjid}"
5+
lifetime_seconds = var.databricks_token_lifetime_seconds
6+
}
7+
8+
provider "databricks" {
9+
alias = "created_workspace"
10+
host = azurerm_databricks_workspace.this.workspace_url
11+
}

variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ variable "infrastructure_encryption_enabled" {
6262

6363
variable "public_network_access_enabled" {
6464
description = "Allow public access for accessing workspace. Set value to false to access workspace only via private link endpoint. Possible values include true or false. Defaults to true. Changing this forces a new resource to be created"
65-
default = false
65+
default = true
6666
type = bool
6767
}
6868

@@ -95,3 +95,9 @@ variable "network_security_group_rules_required" {
9595
default = null
9696
type = string
9797
}
98+
99+
variable "databricks_token_lifetime_seconds" {
100+
description = "Validity of the databricks token in seconds"
101+
default = 86400
102+
type = number
103+
}

0 commit comments

Comments
 (0)