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

Update adb-teradata to use azurerm v4 #164

Merged
merged 1 commit into from
Dec 1, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 85 additions & 65 deletions examples/adb-teradata/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions examples/adb-teradata/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ data "azurerm_client_config" "current" {
data "external" "me" {
program = ["az", "account", "show", "--query", "user"]
}

data "http" "my_public_ip" {
url = "https://ipinfo.io"
}
4 changes: 0 additions & 4 deletions examples/adb-teradata/modules/teradata_vm/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ terraform {
}
}
}

provider "azurerm" {
features {}
}
15 changes: 15 additions & 0 deletions examples/adb-teradata/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
output "pip" {
value = module.test_vm_instance.vm_public_ip
}

output "azure_resource_group_id" {
description = "ID of the created Azure resource group"
value = azurerm_resource_group.this.id
}

output "workspace_id" {
description = "The Databricks workspace ID"
value = azurerm_databricks_workspace.this.workspace_id
}

output "workspace_url" {
description = "The Databricks workspace URL"
value = azurerm_databricks_workspace.this.workspace_url
}
10 changes: 6 additions & 4 deletions examples/adb-teradata/providers.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
source = "hashicorp/azurerm"
version = ">=4.0.0"
}
random = {
source = "hashicorp/random"
}
}
}

provider "azurerm" {
subscription_id = var.subscription_id
features {}
}

provider "random" {
}
2 changes: 1 addition & 1 deletion examples/adb-teradata/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
subscription_id = "<your Azure Subscription ID here>"
spokecidr = "10.179.0.0/20"
no_public_ip = true
rglocation = "southeastasia"
dbfs_prefix = "dbfs"
workspace_prefix = "adb"
9 changes: 5 additions & 4 deletions examples/adb-teradata/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
variable "spokecidr" {
type = string
variable "subscription_id" {
type = string
description = "Azure Subscription ID to deploy the workspace into"
}

variable "no_public_ip" {
type = bool
variable "spokecidr" {
type = string
}

variable "rglocation" {
Expand Down
4 changes: 2 additions & 2 deletions examples/adb-teradata/vnet.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "azurerm_network_security_group" "vmnsg" {
protocol = "Tcp"
source_port_range = "*"
destination_port_range = "22"
source_address_prefix = "*"
source_address_prefix = jsondecode(data.http.my_public_ip.response_body).ip
destination_address_prefix = "*"
}
security_rule {
Expand Down Expand Up @@ -95,7 +95,7 @@ resource "azurerm_subnet" "private" {
virtual_network_name = azurerm_virtual_network.this.name
address_prefixes = [cidrsubnet(var.cidr, 3, 1)]

private_endpoint_network_policies_enabled = true
private_endpoint_network_policies = "Enabled"
private_link_service_network_policies_enabled = true

delegation {
Expand Down
2 changes: 0 additions & 2 deletions examples/adb-teradata/workspace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ resource "azurerm_databricks_workspace" "this" {
sku = "premium"
tags = local.tags
customer_managed_key_enabled = true
//infrastructure_encryption_enabled = true
custom_parameters {
no_public_ip = var.no_public_ip
virtual_network_id = azurerm_virtual_network.this.id
private_subnet_name = azurerm_subnet.private.name
public_subnet_name = azurerm_subnet.public.name
Expand Down