Skip to content

Commit 9710cf5

Browse files
committed
Fixes
1 parent 27e463c commit 9710cf5

File tree

5 files changed

+23
-74
lines changed

5 files changed

+23
-74
lines changed

scenarios/AksOpenAiTerraform/README.md

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ ms.author: ariaamini
88
ms.custom: innovation-engine, linux-related-content
99
---
1010

11-
<!-- TODO: PARAMETERIZE REGION AND SUB IDS -->
12-
1311
## Install AKS extension
1412

1513
Run commands below to set up AKS extensions for Azure.
@@ -18,30 +16,16 @@ Run commands below to set up AKS extensions for Azure.
1816
./terraform/register-preview-features.sh
1917
```
2018

21-
## Set up service principal
22-
23-
A Service Principal is an application within Azure Active Directory with the authentication tokens Terraform needs to perform actions on your behalf.
24-
25-
```bash
26-
# TODO: fix
27-
# az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/$ARM_SUBSCRIPTION_ID"
28-
```
19+
## Set up Subscription ID to authenticate for Terraform
2920

30-
## Setup Infra
21+
Terraform uses the ARM_SUBSCRIPTION_ID environment variable to authenticate while using CLI.
3122

3223
```bash
3324
export ARM_SUBSCRIPTION_ID="0c8875c7-e423-4caa-827a-1f0350bd8dd3"
34-
# For debugging in powershell
35-
# $env:ARM_SUBSCRIPTION_ID = "0c8875c7-e423-4caa-827a-1f0350bd8dd3"
36-
37-
terraform apply
3825
```
3926

40-
## Set up environment
27+
## Run Terraform
4128

4229
```bash
43-
export ARM_CLIENT_ID=""
44-
export ARM_CLIENT_SECRET=""
45-
export ARM_SUBSCRIPTION_ID=""
46-
export ARM_TENANT_ID=""
30+
terraform apply
4731
```

scenarios/AksOpenAiTerraform/terraform/main.tf

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ module "aks_cluster" {
8282
resource_group_id = azurerm_resource_group.rg.id
8383
tenant_id = data.azurerm_client_config.current.tenant_id
8484

85-
kubernetes_version = "1.30.7"
86-
sku_tier = "Free"
85+
kubernetes_version = var.kubernetes_version
86+
sku_tier = "Free"
87+
system_node_pool_vm_size = var.system_node_pool_vm_size
88+
user_node_pool_vm_size = var.user_node_pool_vm_size
8789

8890
system_node_pool_subnet_id = module.virtual_network.subnet_ids[local.system_node_pool_subnet_name]
8991
user_node_pool_subnet_id = module.virtual_network.subnet_ids[local.user_node_pool_subnet_name]
@@ -103,10 +105,10 @@ module "container_registry" {
103105
location = var.location
104106
resource_group_name = azurerm_resource_group.rg.name
105107

106-
log_analytics_workspace_id = module.log_analytics_workspace.id
107-
108-
sku = "Basic"
108+
sku = "Premium"
109109
admin_enabled = true
110+
111+
log_analytics_workspace_id = module.log_analytics_workspace.id
110112
}
111113

112114
module "storage_account" {
@@ -306,7 +308,6 @@ module "openai_private_endpoint" {
306308
resource_group_name = azurerm_resource_group.rg.name
307309
subnet_id = module.virtual_network.subnet_ids[local.vm_subnet_name]
308310
private_connection_resource_id = module.openai.id
309-
is_manual_connection = false
310311
subresource_name = "account"
311312
private_dns_zone_group_name = "AcrPrivateDnsZoneGroup"
312313
private_dns_zone_group_ids = [module.openai_private_dns_zone.id]
@@ -319,7 +320,6 @@ module "acr_private_endpoint" {
319320
resource_group_name = azurerm_resource_group.rg.name
320321
subnet_id = module.virtual_network.subnet_ids[local.vm_subnet_name]
321322
private_connection_resource_id = module.container_registry.id
322-
is_manual_connection = false
323323
subresource_name = "registry"
324324
private_dns_zone_group_name = "AcrPrivateDnsZoneGroup"
325325
private_dns_zone_group_ids = [module.acr_private_dns_zone.id]
@@ -332,7 +332,6 @@ module "key_vault_private_endpoint" {
332332
resource_group_name = azurerm_resource_group.rg.name
333333
subnet_id = module.virtual_network.subnet_ids[local.vm_subnet_name]
334334
private_connection_resource_id = module.key_vault.id
335-
is_manual_connection = false
336335
subresource_name = "vault"
337336
private_dns_zone_group_name = "KeyVaultPrivateDnsZoneGroup"
338337
private_dns_zone_group_ids = [module.key_vault_private_dns_zone.id]
@@ -345,7 +344,6 @@ module "blob_private_endpoint" {
345344
resource_group_name = azurerm_resource_group.rg.name
346345
subnet_id = module.virtual_network.subnet_ids[local.vm_subnet_name]
347346
private_connection_resource_id = module.storage_account.id
348-
is_manual_connection = false
349347
subresource_name = "blob"
350348
private_dns_zone_group_name = "BlobPrivateDnsZoneGroup"
351349
private_dns_zone_group_ids = [module.blob_private_dns_zone.id]

scenarios/AksOpenAiTerraform/terraform/modules/aks/variables.tf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ variable "sku_tier" {
2727
}
2828

2929
variable "system_node_pool_vm_size" {
30-
default = "Standard_D8ds_v5"
31-
type = string
30+
type = string
3231
}
3332

3433
variable "user_node_pool_vm_size" {
35-
default = "Standard_D8ds_v5"
36-
type = string
34+
type = string
3735
}
3836

3937
variable "log_analytics_workspace_id" {

scenarios/AksOpenAiTerraform/terraform/modules/private_endpoint/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ resource "azurerm_private_endpoint" "private_endpoint" {
77
private_service_connection {
88
name = "${var.name}Connection"
99
private_connection_resource_id = var.private_connection_resource_id
10-
is_manual_connection = var.is_manual_connection
11-
subresource_names = try([var.subresource_name], null)
12-
request_message = try(var.request_message, null)
10+
is_manual_connection = false
11+
subresource_names = [var.subresource_name]
1312
}
1413

1514
private_dns_zone_group {
Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,31 @@
11
variable "name" {
2-
description = "(Required) Specifies the name of the private endpoint. Changing this forces a new resource to be created."
3-
type = string
2+
type = string
43
}
54

65
variable "resource_group_name" {
7-
description = "(Required) The name of the resource group. Changing this forces a new resource to be created."
8-
type = string
6+
type = string
97
}
108

119
variable "private_connection_resource_id" {
12-
description = "(Required) Specifies the resource id of the private link service"
13-
type = string
10+
type = string
1411
}
1512

1613
variable "location" {
17-
description = "(Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created."
18-
type = string
14+
type = string
1915
}
2016

2117
variable "subnet_id" {
22-
description = "(Required) Specifies the resource id of the subnet"
23-
type = string
24-
}
25-
26-
variable "is_manual_connection" {
27-
description = "(Optional) Specifies whether the private endpoint connection requires manual approval from the remote resource owner."
28-
type = string
29-
default = false
18+
type = string
3019
}
3120

3221
variable "subresource_name" {
33-
description = "(Optional) Specifies a subresource name which the Private Endpoint is able to connect to."
34-
type = string
35-
default = null
36-
}
37-
38-
variable "request_message" {
39-
description = "(Optional) Specifies a message passed to the owner of the remote resource when the private endpoint attempts to establish the connection to the remote resource."
40-
type = string
41-
default = null
22+
type = string
4223
}
4324

4425
variable "private_dns_zone_group_name" {
45-
description = "(Required) Specifies the Name of the Private DNS Zone Group. Changing this forces a new private_dns_zone_group resource to be created."
46-
type = string
26+
type = string
4727
}
4828

4929
variable "private_dns_zone_group_ids" {
50-
description = "(Required) Specifies the list of Private DNS Zones to include within the private_dns_zone_group."
51-
type = list(string)
52-
}
53-
54-
variable "tags" {
55-
description = "(Optional) Specifies the tags of the network security group"
56-
default = {}
57-
}
58-
59-
variable "private_dns" {
60-
default = {}
30+
type = list(string)
6131
}

0 commit comments

Comments
 (0)