Skip to content

Commit

Permalink
Merge pull request #8 from zorgzerg/master
Browse files Browse the repository at this point in the history
Use 'master_location' istead 'zonal' and 'regional' params in 'master…
  • Loading branch information
kapneh authored Jan 31, 2024
2 parents 6000b87 + bdbf007 commit 9f47954
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 33 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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)

Expand All @@ -35,4 +43,4 @@ ENHANCEMENTS:
NOTES:

* Avoided warning about deprecated subnet definition (fixed #2).
* Required provider yandex >= 0.52
* Required provider yandex >= 0.52
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
32 changes: 4 additions & 28 deletions main.tf
Original file line number Diff line number Diff line change
@@ -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 ? {
Expand Down Expand Up @@ -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"]
}
}

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
yandex = {
source = "yandex-cloud/yandex"
version = ">= 0.70"
version = ">= 0.105.0"
}
}
}

0 comments on commit 9f47954

Please sign in to comment.