mirror of
https://github.com/puppetmaster/typhoon.git
synced 2024-12-25 18:49:33 +01:00
189487ecaa
* Replace v0.11 bracket type hints with Terraform v0.12 list expressions * Use expression syntax instead of interpolated strings, where suggested * Update Azure tutorial and worker pools documentation * Define Terraform and plugin version requirements in versions.tf * Require azurerm ~> 1.27 to support Terraform v0.12 * Require ct ~> 0.3.2 to support Terraform v0.12
35 lines
1.1 KiB
HCL
35 lines
1.1 KiB
HCL
# Organize cluster into a resource group
|
|
resource "azurerm_resource_group" "cluster" {
|
|
name = var.cluster_name
|
|
location = var.region
|
|
}
|
|
|
|
resource "azurerm_virtual_network" "network" {
|
|
resource_group_name = azurerm_resource_group.cluster.name
|
|
|
|
name = var.cluster_name
|
|
location = azurerm_resource_group.cluster.location
|
|
address_space = [var.host_cidr]
|
|
}
|
|
|
|
# Subnets - separate subnets for controller and workers because Azure
|
|
# network security groups are based on IPv4 CIDR rather than instance
|
|
# tags like GCP or security group membership like AWS
|
|
|
|
resource "azurerm_subnet" "controller" {
|
|
resource_group_name = azurerm_resource_group.cluster.name
|
|
|
|
name = "controller"
|
|
virtual_network_name = azurerm_virtual_network.network.name
|
|
address_prefix = cidrsubnet(var.host_cidr, 1, 0)
|
|
}
|
|
|
|
resource "azurerm_subnet" "worker" {
|
|
resource_group_name = azurerm_resource_group.cluster.name
|
|
|
|
name = "worker"
|
|
virtual_network_name = azurerm_virtual_network.network.name
|
|
address_prefix = cidrsubnet(var.host_cidr, 1, 1)
|
|
}
|
|
|