@@ -4,66 +4,62 @@ resource "random_pet" "rg_name" {
44}
55
66resource "azurerm_resource_group" "rg" {
7- name = random_pet. rg_name . id
87 location = var. resource_group_location
8+ name = random_pet. rg_name . id
99}
1010
1111resource "random_id" "log_analytics_workspace_name_suffix" {
1212 byte_length = 8
1313}
1414
1515resource "azurerm_log_analytics_workspace" "test" {
16+ location = var. log_analytics_workspace_location
1617 # The WorkSpace name has to be unique across the whole of azure, not just the current subscription/tenant.
1718 name = " ${ var . log_analytics_workspace_name } -${ random_id . log_analytics_workspace_name_suffix . dec } "
18- location = var. log_analytics_workspace_location
1919 resource_group_name = azurerm_resource_group. rg . name
2020 sku = var. log_analytics_workspace_sku
2121}
2222
2323resource "azurerm_log_analytics_solution" "test" {
24- solution_name = " ContainerInsights"
2524 location = azurerm_log_analytics_workspace. test . location
2625 resource_group_name = azurerm_resource_group. rg . name
27- workspace_resource_id = azurerm_log_analytics_workspace . test . id
26+ solution_name = " ContainerInsights "
2827 workspace_name = azurerm_log_analytics_workspace. test . name
28+ workspace_resource_id = azurerm_log_analytics_workspace. test . id
2929
3030 plan {
31- publisher = " Microsoft"
3231 product = " OMSGallery/ContainerInsights"
32+ publisher = " Microsoft"
3333 }
3434}
3535
3636resource "azurerm_kubernetes_cluster" "k8s" {
37- name = var. cluster_name
3837 location = azurerm_resource_group. rg . location
38+ name = var. cluster_name
3939 resource_group_name = azurerm_resource_group. rg . name
4040 dns_prefix = var. dns_prefix
41+ tags = {
42+ Environment = " Development"
43+ }
4144
45+ default_node_pool {
46+ name = " agentpool"
47+ vm_size = " Standard_D2_v2"
48+ node_count = var. agent_count
49+ }
4250 linux_profile {
4351 admin_username = " ubuntu"
4452
4553 ssh_key {
4654 key_data = file (var. ssh_public_key )
4755 }
4856 }
49-
50- default_node_pool {
51- name = " agentpool"
52- node_count = var. agent_count
53- vm_size = " Standard_D2_v2"
57+ network_profile {
58+ network_plugin = " kubenet"
59+ load_balancer_sku = " standard"
5460 }
55-
5661 service_principal {
5762 client_id = var. aks_service_principal_app_id
5863 client_secret = var. aks_service_principal_client_secret
5964 }
60-
61- network_profile {
62- load_balancer_sku = " standard"
63- network_plugin = " kubenet"
64- }
65-
66- tags = {
67- Environment = " Development"
68- }
6965}
0 commit comments