forked from juice-shop/multi-juicer
-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.tf
72 lines (57 loc) · 1.85 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
terraform {
# For shared state:
# Set the resource group in the backend configuration below, then uncomment and apply!
# Note that you probably already create a resource group. Don't forget to set that correctly in this file.
# backend "azurerm" {
# resource_group_name = "owasp-wrongsecrets"
# storage_account_name = "<storage account name>"
# container_name = "tfstate"
# key = "terraform.tfstate"
# }
}
data "http" "ip" {
url = "http://ipecho.net/plain"
}
provider "azurerm" {
features {}
skip_provider_registration = true
}
data "azurerm_client_config" "current" {}
# If you're using an existing resource group, modify this part.
# Note that you'll need to find/replace references to "azurerm_resource_group.default" to "data.azurerm_resource_group.default"
# data "azurerm_resource_group" "default" {
# name = "owasp-wrongsecrets"
# }
# If you're using an existing resource group, comment this.
resource "azurerm_resource_group" "default" {
name = "owasp-wrongsecrets"
location = var.region
}
resource "azurerm_kubernetes_cluster" "cluster" {
name = var.cluster_name
location = azurerm_resource_group.default.location
resource_group_name = azurerm_resource_group.default.name
dns_prefix = "wrongsecrets"
kubernetes_version = var.cluster_version
api_server_access_profile {
authorized_ip_ranges = ["${data.http.ip.response_body}/32"]
}
network_profile {
network_plugin = "azure"
}
default_node_pool {
name = "default"
enable_auto_scaling = true
min_count = 3
max_count = 50
node_count = 3
vm_size = "Standard_A2m_v2"
}
identity {
type = "SystemAssigned"
}
storage_profile {
disk_driver_enabled = true
}
role_based_access_control_enabled = true
}