mirror of
https://github.com/puppetmaster/typhoon.git
synced 2025-07-31 00:51:35 +02:00
Rename Azure cluster region variable to location
* Rename the region variable to location to align with Azure platform conventions, where resources are created within an Azure location, which are themselves part of broader geographical regions
This commit is contained in:
@ -26,7 +26,7 @@ resource "azurerm_dns_a_record" "etcds" {
|
||||
resource "azurerm_availability_set" "controllers" {
|
||||
name = "${var.cluster_name}-controllers"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
platform_fault_domain_count = 2
|
||||
platform_update_domain_count = 4
|
||||
managed = true
|
||||
@ -38,7 +38,7 @@ resource "azurerm_linux_virtual_machine" "controllers" {
|
||||
|
||||
name = "${var.cluster_name}-controller-${count.index}"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
availability_set_id = azurerm_availability_set.controllers.id
|
||||
size = var.controller_type
|
||||
|
||||
|
@ -17,7 +17,7 @@ resource "azurerm_dns_a_record" "apiserver" {
|
||||
resource "azurerm_public_ip" "apiserver-ipv4" {
|
||||
name = "${var.cluster_name}-apiserver-ipv4"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
sku = "Standard"
|
||||
allocation_method = "Static"
|
||||
}
|
||||
@ -26,7 +26,7 @@ resource "azurerm_public_ip" "apiserver-ipv4" {
|
||||
resource "azurerm_public_ip" "ingress-ipv4" {
|
||||
name = "${var.cluster_name}-ingress-ipv4"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
ip_version = "IPv4"
|
||||
sku = "Standard"
|
||||
allocation_method = "Static"
|
||||
@ -36,7 +36,7 @@ resource "azurerm_public_ip" "ingress-ipv4" {
|
||||
resource "azurerm_public_ip" "ingress-ipv6" {
|
||||
name = "${var.cluster_name}-ingress-ipv6"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
ip_version = "IPv6"
|
||||
sku = "Standard"
|
||||
allocation_method = "Static"
|
||||
@ -46,7 +46,7 @@ resource "azurerm_public_ip" "ingress-ipv6" {
|
||||
resource "azurerm_lb" "cluster" {
|
||||
name = var.cluster_name
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
sku = "Standard"
|
||||
|
||||
frontend_ip_configuration {
|
||||
|
@ -19,7 +19,7 @@ locals {
|
||||
# Organize cluster into a resource group
|
||||
resource "azurerm_resource_group" "cluster" {
|
||||
name = var.cluster_name
|
||||
location = var.region
|
||||
location = var.location
|
||||
}
|
||||
|
||||
resource "azurerm_virtual_network" "network" {
|
||||
|
@ -17,7 +17,7 @@ output "ingress_static_ipv6" {
|
||||
|
||||
# Outputs for worker pools
|
||||
|
||||
output "region" {
|
||||
output "location" {
|
||||
value = azurerm_resource_group.cluster.location
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,9 @@ variable "cluster_name" {
|
||||
|
||||
# Azure
|
||||
|
||||
variable "region" {
|
||||
variable "location" {
|
||||
type = string
|
||||
description = "Azure Region (e.g. centralus , see `az account list-locations --output table`)"
|
||||
description = "Azure location (e.g. centralus , see `az account list-locations --output table`)"
|
||||
}
|
||||
|
||||
variable "dns_zone" {
|
||||
|
@ -4,7 +4,7 @@ module "workers" {
|
||||
|
||||
# Azure
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
region = azurerm_resource_group.cluster.location
|
||||
location = azurerm_resource_group.cluster.location
|
||||
subnet_id = azurerm_subnet.worker.id
|
||||
security_group_id = azurerm_network_security_group.worker.id
|
||||
backend_address_pool_ids = local.backend_address_pool_ids
|
||||
|
@ -5,9 +5,9 @@ variable "name" {
|
||||
|
||||
# Azure
|
||||
|
||||
variable "region" {
|
||||
variable "location" {
|
||||
type = string
|
||||
description = "Must be set to the Azure Region of cluster"
|
||||
description = "Must be set to the Azure location of cluster"
|
||||
}
|
||||
|
||||
variable "resource_group_name" {
|
||||
|
@ -6,7 +6,7 @@ locals {
|
||||
resource "azurerm_linux_virtual_machine_scale_set" "workers" {
|
||||
name = "${var.name}-worker"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.region
|
||||
location = var.location
|
||||
sku = var.vm_type
|
||||
instances = var.worker_count
|
||||
# instance name prefix for instances in the set
|
||||
@ -70,7 +70,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "workers" {
|
||||
resource "azurerm_monitor_autoscale_setting" "workers" {
|
||||
name = "${var.name}-maintain-desired"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.region
|
||||
location = var.location
|
||||
# autoscale
|
||||
enabled = true
|
||||
target_resource_id = azurerm_linux_virtual_machine_scale_set.workers.id
|
||||
|
@ -32,7 +32,7 @@ resource "azurerm_dns_a_record" "etcds" {
|
||||
resource "azurerm_availability_set" "controllers" {
|
||||
name = "${var.cluster_name}-controllers"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
platform_fault_domain_count = 2
|
||||
platform_update_domain_count = 4
|
||||
managed = true
|
||||
@ -44,7 +44,7 @@ resource "azurerm_linux_virtual_machine" "controllers" {
|
||||
|
||||
name = "${var.cluster_name}-controller-${count.index}"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
availability_set_id = azurerm_availability_set.controllers.id
|
||||
size = var.controller_type
|
||||
|
||||
|
@ -17,7 +17,7 @@ resource "azurerm_dns_a_record" "apiserver" {
|
||||
resource "azurerm_public_ip" "apiserver-ipv4" {
|
||||
name = "${var.cluster_name}-apiserver-ipv4"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
sku = "Standard"
|
||||
allocation_method = "Static"
|
||||
}
|
||||
@ -26,7 +26,7 @@ resource "azurerm_public_ip" "apiserver-ipv4" {
|
||||
resource "azurerm_public_ip" "ingress-ipv4" {
|
||||
name = "${var.cluster_name}-ingress-ipv4"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
ip_version = "IPv4"
|
||||
sku = "Standard"
|
||||
allocation_method = "Static"
|
||||
@ -36,7 +36,7 @@ resource "azurerm_public_ip" "ingress-ipv4" {
|
||||
resource "azurerm_public_ip" "ingress-ipv6" {
|
||||
name = "${var.cluster_name}-ingress-ipv6"
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
ip_version = "IPv6"
|
||||
sku = "Standard"
|
||||
allocation_method = "Static"
|
||||
@ -46,7 +46,7 @@ resource "azurerm_public_ip" "ingress-ipv6" {
|
||||
resource "azurerm_lb" "cluster" {
|
||||
name = var.cluster_name
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
location = var.region
|
||||
location = var.location
|
||||
sku = "Standard"
|
||||
|
||||
frontend_ip_configuration {
|
||||
|
@ -19,7 +19,7 @@ locals {
|
||||
# Organize cluster into a resource group
|
||||
resource "azurerm_resource_group" "cluster" {
|
||||
name = var.cluster_name
|
||||
location = var.region
|
||||
location = var.location
|
||||
}
|
||||
|
||||
resource "azurerm_virtual_network" "network" {
|
||||
|
@ -17,7 +17,7 @@ output "ingress_static_ipv6" {
|
||||
|
||||
# Outputs for worker pools
|
||||
|
||||
output "region" {
|
||||
output "location" {
|
||||
value = azurerm_resource_group.cluster.location
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,9 @@ variable "cluster_name" {
|
||||
|
||||
# Azure
|
||||
|
||||
variable "region" {
|
||||
variable "location" {
|
||||
type = string
|
||||
description = "Azure Region (e.g. centralus , see `az account list-locations --output table`)"
|
||||
description = "Azure location (e.g. centralus , see `az account list-locations --output table`)"
|
||||
}
|
||||
|
||||
variable "dns_zone" {
|
||||
|
@ -4,7 +4,7 @@ module "workers" {
|
||||
|
||||
# Azure
|
||||
resource_group_name = azurerm_resource_group.cluster.name
|
||||
region = azurerm_resource_group.cluster.location
|
||||
location = azurerm_resource_group.cluster.location
|
||||
subnet_id = azurerm_subnet.worker.id
|
||||
security_group_id = azurerm_network_security_group.worker.id
|
||||
backend_address_pool_ids = local.backend_address_pool_ids
|
||||
|
@ -5,9 +5,9 @@ variable "name" {
|
||||
|
||||
# Azure
|
||||
|
||||
variable "region" {
|
||||
variable "location" {
|
||||
type = string
|
||||
description = "Must be set to the Azure Region of cluster"
|
||||
description = "Must be set to the Azure location of cluster"
|
||||
}
|
||||
|
||||
variable "resource_group_name" {
|
||||
|
@ -11,7 +11,7 @@ locals {
|
||||
resource "azurerm_linux_virtual_machine_scale_set" "workers" {
|
||||
name = "${var.name}-worker"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.region
|
||||
location = var.location
|
||||
sku = var.vm_type
|
||||
instances = var.worker_count
|
||||
# instance name prefix for instances in the set
|
||||
@ -91,7 +91,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "workers" {
|
||||
resource "azurerm_monitor_autoscale_setting" "workers" {
|
||||
name = "${var.name}-maintain-desired"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.region
|
||||
location = var.location
|
||||
# autoscale
|
||||
enabled = true
|
||||
target_resource_id = azurerm_linux_virtual_machine_scale_set.workers.id
|
||||
|
Reference in New Issue
Block a user