Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update azurerm to latest version 2.39 #424

Merged
merged 8 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions modules/azure/blob/blob.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
resource "azurerm_storage_account" "storage_acc" {
name = "${var.cluster_name}config"
resource_group_name = var.resource_group_name
location = var.azure_location
account_kind = "BlobStorage"
account_tier = "Standard"
account_replication_type = "LRS"
enable_https_traffic_only = true
resource_group_name = var.resource_group_name
}

resource "azurerm_storage_container" "ignition" {
name = "ignition"
resource_group_name = var.resource_group_name
storage_account_name = azurerm_storage_account.storage_acc.name
container_access_type = "private"
}
Expand Down
3 changes: 1 addition & 2 deletions modules/azure/master-as/master-ignition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ resource "azurerm_storage_blob" "ignition_blob" {

name = "master-ignition${count.index}-${md5(var.user_data[count.index])}.yaml"

resource_group_name = var.resource_group_name
storage_account_name = var.storage_acc
storage_container_name = var.storage_container

type = "block"
type = "Block"
source = "${path.cwd}/generated/master-ignition${count.index}.yaml"
}

Expand Down
23 changes: 4 additions & 19 deletions modules/azure/vnet/vnet-subnets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "azurerm_subnet" "vpn_subnet" {
virtual_network_name = azurerm_virtual_network.cluster_vnet.name

# Use first /28 for /16 (e.g. for 10.0.0.0/16 10.0.0.0/28 will be used).
address_prefix = cidrsubnet(var.vnet_cidr, 12, 0)
address_prefixes = [cidrsubnet(var.vnet_cidr, 12, 0)]
}

resource "azurerm_subnet" "bastion_subnet" {
Expand All @@ -31,37 +31,22 @@ resource "azurerm_subnet" "bastion_subnet" {
virtual_network_name = azurerm_virtual_network.cluster_vnet.name

# NOTE: bastion_cidr should be unique across clusters, when VPN enabled.
address_prefix = var.bastion_cidr
address_prefixes = [var.bastion_cidr]

# We stil need to hold the old deprecated way of defining network security group
# https://github.com/hashicorp/terraform/issues/19722
network_security_group_id = azurerm_network_security_group.bastion.id
}

resource "azurerm_subnet" "vault_subnet" {
name = "${var.cluster_name}_vault_subnet"
resource_group_name = var.resource_group_name
virtual_network_name = azurerm_virtual_network.cluster_vnet.name
address_prefix = cidrsubnet(var.vnet_cidr, 8, 1)

# We stil need to hold the old deprecated way of defining network security group
# https://github.com/hashicorp/terraform/issues/19722
network_security_group_id = azurerm_network_security_group.vault.id
address_prefixes = [cidrsubnet(var.vnet_cidr, 8, 1)]
}

resource "azurerm_subnet" "worker_subnet" {
name = "${var.cluster_name}_worker_subnet"
resource_group_name = var.resource_group_name
virtual_network_name = azurerm_virtual_network.cluster_vnet.name
address_prefix = cidrsubnet(var.vnet_cidr, 8, 2)

# We stil need to hold the old deprecated way of defining network security group
# https://github.com/hashicorp/terraform/issues/19722
network_security_group_id = azurerm_network_security_group.worker.id

# Same for rt association
# https://www.terraform.io/docs/providers/azurerm/r/subnet_route_table_association.html
route_table_id = azurerm_route_table.worker_rt.id
address_prefixes = [cidrsubnet(var.vnet_cidr, 8, 2)]

# We need the storage service endpoint to grant the control plane VNET access to the TC's storage accounts
service_endpoints = ["Microsoft.Storage"]
Expand Down
7 changes: 4 additions & 3 deletions platforms/azure/giantnetes/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
provider "azurerm" {
# versions 1.34.0 and 1.35.0 break e2e tests, please don't use them.
version = "~> 1.33.0"
version = "~> 2.39.0"

environment = var.azure_cloud
features {}
metadata_host = var.metadata_host
environment = var.azure_cloud
}

data "azurerm_client_config" "current" {}
Expand Down
11 changes: 8 additions & 3 deletions platforms/azure/giantnetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ variable "azure_location" {

variable "azure_cloud" {
description = "Azure cloud to use. Possible values can be found here: https://github.com/Azure/go-autorest/blob/ec5f4903f77ed9927ac95b19ab8e44ada64c1356/autorest/azure/environments.go#L13"
default = "AZUREPUBLICCLOUD"
default = "public"
}

variable "metadata_host" {
description = "The Hostname of the Azure Metadata Service, used to obtain the Cloud Environment when using a Custom Azure Environment."
default = "management.azure.com"
}

# Azure has different number of failure domains depending on location.
Expand Down Expand Up @@ -125,12 +130,12 @@ variable "flatcar_linux_version" {
}

variable "vault_image_publisher" {
type = string
type = string
default = "kinvolk"
}

variable "vault_image_offer" {
type = string
type = string
default = "flatcar-container-linux-free"
}

Expand Down