@@ -38,43 +38,47 @@ locals {
3838 }
3939}
4040
41- resource "azurerm_resource_group" "example " {
41+ resource "azurerm_resource_group" "this " {
4242 name = " ${ local . prefix } -rg"
4343 location = var. region
4444 tags = local. tags
4545}
4646
4747output "azure_region" {
48- value = azurerm_resource_group. example . location
48+ value = azurerm_resource_group. this . location
4949}
5050
5151output "test_resource_group" {
52- value = azurerm_resource_group. example . name
52+ value = azurerm_resource_group. this . name
5353}
5454
55- resource "azurerm_databricks_workspace" "example" {
55+ output "test_resource_group_id" {
56+ value = azurerm_resource_group. this . id
57+ }
58+
59+ resource "azurerm_databricks_workspace" "this" {
5660 name = " ${ local . prefix } -workspace"
57- resource_group_name = azurerm_resource_group. example . name
58- location = azurerm_resource_group. example . location
61+ resource_group_name = azurerm_resource_group. this . name
62+ location = azurerm_resource_group. this . location
5963 sku = " premium"
6064 managed_resource_group_name = " ${ local . prefix } -workspace-rg"
6165 tags = local. tags
6266}
6367
6468output "databricks_azure_workspace_resource_id" {
6569 // The ID of the Databricks Workspace in the Azure management plane.
66- value = azurerm_databricks_workspace. example . id
70+ value = azurerm_databricks_workspace. this . id
6771}
6872
6973output "databricks_host" {
70- value = " https://${ azurerm_databricks_workspace . example . workspace_url } /"
74+ value = " https://${ azurerm_databricks_workspace . this . workspace_url } /"
7175}
7276
7377// ADLSv1 resource
7478resource "azurerm_data_lake_store" "gen1" {
7579 name = " ${ local . prefix } adlsv1"
76- resource_group_name = azurerm_resource_group. example . name
77- location = azurerm_resource_group. example . location
80+ resource_group_name = azurerm_resource_group. this . name
81+ location = azurerm_resource_group. this . location
7882}
7983
8084output "test_data_lake_store_name" {
@@ -84,8 +88,8 @@ output "test_data_lake_store_name" {
8488# Create container in storage acc and container for use by blob mount tests
8589resource "azurerm_storage_account" "v2" {
8690 name = " ${ local . prefix } adlsv2"
87- resource_group_name = azurerm_resource_group. example . name
88- location = azurerm_resource_group. example . location
91+ resource_group_name = azurerm_resource_group. this . name
92+ location = azurerm_resource_group. this . location
8993 account_tier = " Standard"
9094 account_replication_type = " LRS"
9195 account_kind = " StorageV2"
@@ -111,7 +115,7 @@ output "test_storage_v2_wasbs" {
111115 value = azurerm_storage_container. wasbs . name
112116}
113117
114- data "azurerm_storage_account_blob_container_sas" "example " {
118+ data "azurerm_storage_account_blob_container_sas" "this " {
115119 connection_string = azurerm_storage_account. v2 . primary_connection_string
116120 container_name = azurerm_storage_container. wasbs . name
117121 https_only = true
@@ -128,64 +132,63 @@ data "azurerm_storage_account_blob_container_sas" "example" {
128132}
129133
130134output "test_storage_v2_wasbs_sas" {
131- value = data. azurerm_storage_account_blob_container_sas . example . sas
135+ value = data. azurerm_storage_account_blob_container_sas . this . sas
132136 sensitive = true
133137}
134138
135- resource "azurerm_storage_blob" "example " {
139+ resource "azurerm_storage_blob" "this " {
136140 name = " main.tf"
137141 storage_account_name = azurerm_storage_account. v2 . name
138142 storage_container_name = azurerm_storage_container. wasbs . name
139143 type = " Block"
140144 source = " ${ path . module } /main.tf"
141145}
142146
143- resource "azurerm_key_vault" "example " {
147+ resource "azurerm_key_vault" "this " {
144148 name = " ${ local . prefix } -kv"
145- location = azurerm_resource_group. example . location
146- resource_group_name = azurerm_resource_group. example . name
149+ location = azurerm_resource_group. this . location
150+ resource_group_name = azurerm_resource_group. this . name
147151 tenant_id = data. azurerm_client_config . current . tenant_id
148152 purge_protection_enabled = false
149153 sku_name = " standard"
150154 tags = local. tags
155+ }
151156
152- access_policy {
153- tenant_id = data. azurerm_client_config . current . tenant_id
154- object_id = data. azurerm_client_config . current . object_id
155- secret_permissions = [
156- " delete" , " get" , " list" , " set"
157- ]
158- }
157+ resource "azurerm_key_vault_access_policy" "this" {
158+ key_vault_id = azurerm_key_vault. this . id
159+ tenant_id = data. azurerm_client_config . current . tenant_id
160+ object_id = data. azurerm_client_config . current . object_id
161+ secret_permissions = [" Delete" , " Get" , " List" , " Set" ]
159162}
160163
161164output "test_key_vault_name" {
162- value = azurerm_key_vault. example . name
165+ value = azurerm_key_vault. this . name
163166}
164167
165168output "test_key_vault_resource_id" {
166- value = azurerm_key_vault. example . id
169+ value = azurerm_key_vault. this . id
167170}
168171
169172output "test_key_vault_dns_name" {
170- value = azurerm_key_vault. example . vault_uri
173+ value = azurerm_key_vault. this . vault_uri
171174}
172175
173176// "Key Vault Administrator" role required for SP
174- resource "azurerm_key_vault_secret" "example " {
177+ resource "azurerm_key_vault_secret" "this " {
175178 name = " answer"
176179 value = " 42"
177- key_vault_id = azurerm_key_vault. example . id
180+ key_vault_id = azurerm_key_vault. this . id
178181 tags = local. tags
179182}
180183
181184output "test_key_vault_secret" {
182- value = azurerm_key_vault_secret. example . name
185+ value = azurerm_key_vault_secret. this . name
183186}
184187
185188output "test_key_vault_secret_value" {
186189 // this is for testing purposes only.
187190 // must not be a practice for production.
188- value = azurerm_key_vault_secret. example . value
191+ value = azurerm_key_vault_secret. this . value
189192 sensitive = true
190193}
191194
0 commit comments