-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
58 lines (47 loc) · 1.3 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
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 2.49.0"
}
}
backend "azurerm" {
resource_group_name = "tfstate-rg-dev"
storage_account_name = "<storage-account>"
container_name = "tfstate"
key = "terraform.tfstate"
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name = "imranrg-${var.env_name}"
location = "West US 2"
tags = {
"Environment" = "Terraform Getting Started"
"Team" = "DevOps"
}
}
resource "azurerm_container_registry" "acr" {
name = "acr${var.env_name}"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = "Basic"
admin_enabled = false
}
resource "azurerm_kubernetes_cluster" "cluster" {
name = "${var.cluster_name}-${var.env_name}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
dns_prefix = "imrank8scluster-${var.env_name}"
default_node_pool {
name = "default"
node_count = "1"
vm_size = var.instance_type
enable_auto_scaling = false
}
identity {
type = "SystemAssigned"
}
}