From 3bba1ba0dc4498d32f101c18911af6eddd0a34dc Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Sat, 27 Oct 2018 22:46:10 -0700 Subject: [PATCH] Use new azurerm_network_interface_backend_address_pool_association * Require terraform-provider-azurerm v1.17+ * Inline load_balancer_backend_address_pools_ids is deprecated and scheduled for removal in the v2.0 provider * https://github.com/terraform-providers/terraform-provider-azurerm/pull/2079 --- CHANGES.md | 4 +++- azure/container-linux/kubernetes/controllers.tf | 10 +++++++--- azure/container-linux/kubernetes/require.tf | 2 +- azure/container-linux/kubernetes/workers/ingress.tf | 1 - 4 files changed, 11 insertions(+), 6 deletions(-) delete mode 100644 azure/container-linux/kubernetes/workers/ingress.tf diff --git a/CHANGES.md b/CHANGES.md index 6f16dc44..bde308e1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,7 +18,9 @@ Notable changes between versions. #### Azure -* Add `primary` field to `ip_configuration`. Required by `terraform-provider-azurerm` v1.17+ ([#331](https://github.com/poseidon/typhoon/pull/331)) +* Use new `azurerm_network_interface_backend_address_pool_association` ([#332](https://github.com/poseidon/typhoon/pull/332)) + * Require `terraform-provider-azurerm` v1.17+ (action required) +* Add `primary` field to `ip_configuration` needed by v1.17+ ([#331](https://github.com/poseidon/typhoon/pull/331)) #### Addons diff --git a/azure/container-linux/kubernetes/controllers.tf b/azure/container-linux/kubernetes/controllers.tf index 0f3c3efb..3aa96b98 100644 --- a/azure/container-linux/kubernetes/controllers.tf +++ b/azure/container-linux/kubernetes/controllers.tf @@ -105,12 +105,16 @@ resource "azurerm_network_interface" "controllers" { # public IPv4 public_ip_address_id = "${element(azurerm_public_ip.controllers.*.id, count.index)}" - - # backend address pool to which the NIC should be added - load_balancer_backend_address_pools_ids = ["${azurerm_lb_backend_address_pool.controller.id}"] } } +# Add controller NICs to the controller backend address pool +resource "azurerm_network_interface_backend_address_pool_association" "controllers" { + network_interface_id = "${azurerm_network_interface.controllers.id}" + ip_configuration_name = "ip0" + backend_address_pool_id = "${azurerm_lb_backend_address_pool.controller.id}" +} + # Controller public IPv4 addresses resource "azurerm_public_ip" "controllers" { count = "${var.controller_count}" diff --git a/azure/container-linux/kubernetes/require.tf b/azure/container-linux/kubernetes/require.tf index bd2e49f6..b375346c 100644 --- a/azure/container-linux/kubernetes/require.tf +++ b/azure/container-linux/kubernetes/require.tf @@ -5,7 +5,7 @@ terraform { } provider "azurerm" { - version = "~> 1.16" + version = "~> 1.17" } provider "local" { diff --git a/azure/container-linux/kubernetes/workers/ingress.tf b/azure/container-linux/kubernetes/workers/ingress.tf deleted file mode 100644 index 8b137891..00000000 --- a/azure/container-linux/kubernetes/workers/ingress.tf +++ /dev/null @@ -1 +0,0 @@ -