-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
79 lines (66 loc) · 1.51 KB
/
main.tf
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.0.0"
}
}
}
provider "azurerm" {
features {
key_vault {
purge_soft_deleted_secrets_on_destroy = true
recover_soft_deleted_secrets = true
}
}
}
resource "azurerm_resource_group" "rg1" {
name = var.rg_name
location = var.location
}
module "keyvault" {
source = "./modules/keyvault"
keyvault_name = var.keyvault_name
location = var.location
rg_name = var.rg_name
depends_on = [
azurerm_resource_group.rg1
]
}
resource "azurerm_key_vault_secret" "initial" {
name = "Initial--Secret"
value = "InitialSecret"
key_vault_id = module.keyvault.keyvault_id
depends_on = [
module.keyvault
]
}
resource "azurerm_virtual_network" "aksvnet" {
name = "aks-network"
location = var.location
resource_group_name = var.rg_name
address_space = ["10.0.0.0/8"]
depends_on = [
azurerm_resource_group.rg1
]
}
resource "azurerm_subnet" "aks-default" {
name = "aks-default-subnet"
virtual_network_name = azurerm_virtual_network.aksvnet.name
resource_group_name = var.rg_name
address_prefixes = ["10.240.0.0/16"]
depends_on = [
azurerm_virtual_network.aksvnet
]
}
module "aks" {
source = "./modules/aks/"
location = var.location
rg_name = var.rg_name
environment = var.environment
ssh_public_key = var.ssh_signing_key
subnet_id = azurerm_subnet.aks-default.id
depends_on = [
azurerm_subnet.aks-default
]
}