diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a33bc5e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +## 2.1.0 (August 25, 2021) + +ENHANCEMENTS: + +* Added attribute `security_group_ids` of node group. + +NOTES: + +* Avoided warning about deprecated subnet definition (fixed #2). +* Required provider yandex >= 0.52 \ No newline at end of file diff --git a/README.md b/README.md index 6b5f97d..0fdc16d 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ value is a map of node group attributes. | auto_upgrade | Boolean flag that specifies if node group can be upgraded automatically. | `bool` | `true` | no | | auto_repair | Boolean flag that specifies if node group can be repaired automatically. | `bool` | `true` | no | | maintenance_windows | List of day intervals, when maintenance is allowed for this node group. | `list(map(string))` | [] | no | +| security_group_ids | Security group ids for network interface. | `set(string)` | | no | ## Outputs @@ -155,10 +156,10 @@ value is a map of node group attributes. | Name | Version | |------|---------| | terraform | >= 0.13.0 | -| yandex | >= 0.44.0 | +| yandex | >= 0.52.0 | ## Providers | Name | Version | |------|---------| -| yandex | >= 0.44.0 | +| yandex | >= 0.52.0 | diff --git a/main.tf b/main.tf index a778701..d942a6a 100644 --- a/main.tf +++ b/main.tf @@ -169,6 +169,12 @@ resource "yandex_kubernetes_node_group" "node_groups" { scheduling_policy { preemptible = lookup(each.value, "preemptible", false) } + + network_interface { + subnet_ids = [for location in lookup(var.node_groups_locations, each.key, local.node_groups_default_locations) : location.subnet_id] + nat = lookup(each.value, "nat", null) + security_group_ids = lookup(each.value, "security_group_ids", null) + } } scale_policy { @@ -196,8 +202,7 @@ resource "yandex_kubernetes_node_group" "node_groups" { for_each = lookup(var.node_groups_locations, each.key, local.node_groups_default_locations) content { - zone = location.value.zone - subnet_id = location.value.subnet_id + zone = location.value.zone } } } diff --git a/versions.tf b/versions.tf index cb69980..df1e3c0 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { yandex = { source = "yandex-cloud/yandex" - version = ">= 0.44" + version = ">= 0.52" } } }