From bdbf00701055a1a60dd2c880f47fdc4499fe7d7c Mon Sep 17 00:00:00 2001 From: Senko Anton Date: Thu, 18 Jan 2024 13:20:47 +0700 Subject: [PATCH] Use 'master_location' istead 'zonal' and 'regional' params in 'master' block --- CHANGELOG.md | 12 ++++++++++-- README.md | 4 ++-- main.tf | 32 ++++---------------------------- versions.tf | 2 +- 4 files changed, 17 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8509467..2e4798b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 2.3.0 (January 18, 2024) + +NOTES: + +* Change attributes of cluster: use `master_location` instead `zonal` and `regional` +* Ready for migration from C to D allocataion zone +* Required provider yandex >= 0.105.0 + ## 2.2.1 (August 17, 2022) BUG FIXES: @@ -24,7 +32,7 @@ NOTES: * Required provider yandex >= 0.70 * Avoided usage of deprecated attribute - `yandex_kubernetes_node_group.instance_template.nat` (fixed #3) + `yandex_kubernetes_node_group.instance_template.nat` (fixed #3) ## 2.1.0 (August 25, 2021) @@ -35,4 +43,4 @@ ENHANCEMENTS: NOTES: * Avoided warning about deprecated subnet definition (fixed #2). -* Required provider yandex >= 0.52 \ No newline at end of file +* Required provider yandex >= 0.52 diff --git a/README.md b/README.md index f013b52..2a00ea3 100644 --- a/README.md +++ b/README.md @@ -164,10 +164,10 @@ value is a map of node group attributes. | Name | Version | |-----------|------------| | terraform | > = 0.13.0 | -| yandex | > = 0.70 | +| yandex | > = 0.105.0 | ## Providers | Name | Version | |--------|------------| -| yandex | > = 0.70 | +| yandex | > = 0.105.0 | diff --git a/main.tf b/main.tf index 94052ef..79bb0e3 100644 --- a/main.tf +++ b/main.tf @@ -1,11 +1,4 @@ locals { - master_regions = length(var.master_locations) > 1 ? [{ - region = var.master_region - locations = var.master_locations - }] : [] - - master_locations = length(var.master_locations) > 1 ? [] : var.master_locations - service_account_name = var.service_account_id == null ? var.service_account_name : null common_ssh_keys_metadata = length(var.node_groups_default_ssh_keys) > 0 ? { @@ -92,29 +85,12 @@ resource "yandex_kubernetes_cluster" "cluster" { public_ip = var.master_public_ip security_group_ids = var.master_security_group_ids - dynamic "zonal" { - for_each = local.master_locations - - content { - zone = zonal.value["zone"] - subnet_id = zonal.value["subnet_id"] - } - } - - dynamic "regional" { - for_each = local.master_regions + dynamic "master_location" { + for_each = var.master_locations content { - region = regional.value["region"] - - dynamic "location" { - for_each = regional.value["locations"] - - content { - zone = location.value["zone"] - subnet_id = location.value["subnet_id"] - } - } + zone = master_location.value["zone"] + subnet_id = master_location.value["subnet_id"] } } diff --git a/versions.tf b/versions.tf index 6ca35aa..2d3e62c 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { yandex = { source = "yandex-cloud/yandex" - version = ">= 0.70" + version = ">= 0.105.0" } } }