Skip to content

Commit

Permalink
Added attribute security_group_ids of node group
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Remizov committed Aug 25, 2021
1 parent d007c95 commit a6588d7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 |
9 changes: 7 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
}
}
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.44"
version = ">= 0.52"
}
}
}

0 comments on commit a6588d7

Please sign in to comment.