Skip to content

Commit c58829d

Browse files
committed
enabling aks
1 parent faccc33 commit c58829d

File tree

3 files changed

+41
-27
lines changed

3 files changed

+41
-27
lines changed

terraform/acr_aks.tf

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@ resource "azurerm_container_registry" "this_container_registry" {
1212
depends_on = [azurerm_resource_group.this_resource_group]
1313
}
1414

15-
# resource "azurerm_kubernetes_cluster" "this_aks_cluster" {
16-
# name = var.aks_name
17-
# location = var.location
18-
# resource_group_name = azurerm_resource_group.this_resource_group.name
19-
# dns_prefix = "DSB"
20-
21-
22-
# default_node_pool {
23-
# name = "default"
24-
# node_count = 1
25-
# vm_size = "Standard_A2_v2"
26-
# }
27-
28-
# identity {
29-
# type = "UserAssigned"
30-
# identity_ids = [azurerm_user_assigned_identity.this_uaid.id]
31-
# }
32-
33-
# tags = {
34-
# Environment = "Production"
35-
# }
36-
# depends_on = [
37-
# azurerm_role_assignment.uaid_contributor,
38-
# azurerm_role_assignment.acr_pull,
39-
# azurerm_role_assignment.acr_push
40-
# ]
41-
# }
15+
resource "azurerm_kubernetes_cluster" "this_aks_cluster" {
16+
name = var.aks_name
17+
location = var.location
18+
resource_group_name = azurerm_resource_group.this_resource_group.name
19+
dns_prefix = "DSB"
20+
21+
22+
default_node_pool {
23+
name = "default"
24+
node_count = 1
25+
vm_size = "Standard_A2_v2"
26+
}
27+
28+
identity {
29+
type = "UserAssigned"
30+
identity_ids = [azurerm_user_assigned_identity.this_uaid.id]
31+
}
32+
33+
tags = {
34+
Environment = "Production"
35+
}
36+
depends_on = [
37+
azurerm_role_assignment.uaid_contributor,
38+
azurerm_role_assignment.acr_pull,
39+
azurerm_role_assignment.acr_push
40+
]
41+
}
4242

terraform/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ output "acr_name" {
44

55
output "acr_url" {
66
value = azurerm_container_registry.this_container_registry.login_server
7+
}
8+
9+
output "aks_name" {
10+
value = azurerm_kubernetes_cluster.this_aks_cluster.name
711
}

terraform/variable-group.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@ resource "azuredevops_variable_group" "infra_variable_group" {
1414
name = "ACR_SERVICE_CONNECTION"
1515
value = azuredevops_serviceendpoint_azurecr.acr_registry_endpoint.id
1616
}
17+
18+
variable {
19+
name = "AKS_CLUSTER_NAME"
20+
value = azurerm_kubernetes_cluster.this_aks_cluster.name
21+
}
22+
23+
variable {
24+
name = "AZ_SUBSCRIPTION_ENDPOINT"
25+
value = azuredevops_serviceendpoint_azurerm.this.id
26+
}
1727
}

0 commit comments

Comments
 (0)