-
Notifications
You must be signed in to change notification settings - Fork 513
Expand file tree
/
Copy pathmain.tf
More file actions
54 lines (46 loc) · 1.7 KB
/
main.tf
File metadata and controls
54 lines (46 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
resource "random_id" "prefix" {
byte_length = 8
}
resource "azurerm_resource_group" "main" {
count = var.create_resource_group ? 1 : 0
location = var.location
name = coalesce(var.resource_group_name, "${random_id.prefix.hex}-rg")
}
locals {
resource_group = {
name = var.create_resource_group ? azurerm_resource_group.main[0].name : var.resource_group_name
location = var.location
}
}
resource "azurerm_virtual_network" "test" {
address_space = ["10.52.0.0/16"]
location = local.resource_group.location
name = "${random_id.prefix.hex}-vn"
resource_group_name = local.resource_group.name
}
resource "azurerm_subnet" "test" {
address_prefixes = ["10.52.0.0/24"]
name = "${random_id.prefix.hex}-sn"
resource_group_name = local.resource_group.name
virtual_network_name = azurerm_virtual_network.test.name
}
resource "azurerm_dns_zone" "aks_web_app_routing" {
name = "fakeaks.com"
resource_group_name = local.resource_group.name
}
module "aks_without_monitor" {
source = "../.."
prefix = "prefix2-${random_id.prefix.hex}"
resource_group_name = local.resource_group.name
location = local.resource_group.location
admin_username = null
azure_policy_enabled = true
disk_encryption_set_id = azurerm_disk_encryption_set.des.id
#checkov:skip=CKV_AZURE_4:The logging is turn off for demo purpose. DO NOT DO THIS IN PRODUCTION ENVIRONMENT!
log_analytics_workspace_enabled = false
net_profile_pod_cidr = "10.1.0.0/16"
role_based_access_control_enabled = true
web_app_routing = {
dns_zone_ids = [azurerm_dns_zone.aks_web_app_routing.id]
}
}