Skip to content

Commit 4543ab4

Browse files
authored
feat: Add support for specifiying NTP address to use private Amazon Time Sync Service (terraform-aws-modules#2125)
1 parent 62b776f commit 4543ab4

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ We are grateful to the community for contributing bugfixes and improvements! Ple
335335
| <a name="input_node_security_group_description"></a> [node\_security\_group\_description](#input\_node\_security\_group\_description) | Description of the node security group created | `string` | `"EKS node shared security group"` | no |
336336
| <a name="input_node_security_group_id"></a> [node\_security\_group\_id](#input\_node\_security\_group\_id) | ID of an existing security group to attach to the node groups created | `string` | `""` | no |
337337
| <a name="input_node_security_group_name"></a> [node\_security\_group\_name](#input\_node\_security\_group\_name) | Name to use on node security group created | `string` | `null` | no |
338+
| <a name="input_node_security_group_ntp_ipv4_cidr_block"></a> [node\_security\_group\_ntp\_ipv4\_cidr\_block](#input\_node\_security\_group\_ntp\_ipv4\_cidr\_block) | IPv4 CIDR block to allow NTP egress. Default is public IP space, but [Amazon Time Sync Service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html) can be used as well with `["169.254.169.123/32"]` | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
339+
| <a name="input_node_security_group_ntp_ipv6_cidr_block"></a> [node\_security\_group\_ntp\_ipv6\_cidr\_block](#input\_node\_security\_group\_ntp\_ipv6\_cidr\_block) | IPv4 CIDR block to allow NTP egress. Default is public IP space, but [Amazon Time Sync Service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html) can be used as well with `["fd00:ec2::123/128"]` | `list(string)` | <pre>[<br> "::/0"<br>]</pre> | no |
338340
| <a name="input_node_security_group_tags"></a> [node\_security\_group\_tags](#input\_node\_security\_group\_tags) | A map of additional tags to add to the node security group created | `map(string)` | `{}` | no |
339341
| <a name="input_node_security_group_use_name_prefix"></a> [node\_security\_group\_use\_name\_prefix](#input\_node\_security\_group\_use\_name\_prefix) | Determines whether node security group name (`node_security_group_name`) is used as a prefix | `string` | `true` | no |
340342
| <a name="input_openid_connect_audiences"></a> [openid\_connect\_audiences](#input\_openid\_connect\_audiences) | List of OpenID Connect audience client IDs to add to the IRSA provider | `list(string)` | `[]` | no |

examples/complete/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ module "eks" {
7777
}
7878

7979
# Extend node-to-node security group rules
80+
node_security_group_ntp_ipv4_cidr_block = ["169.254.169.123/32"]
8081
node_security_group_additional_rules = {
8182
ingress_self_all = {
8283
description = "Node to node all ports/protocols"

examples/eks_managed_node_group/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ module "eks" {
9292
}
9393

9494
# Extend node-to-node security group rules
95+
node_security_group_ntp_ipv4_cidr_block = ["fd00:ec2::123/128"]
9596
node_security_group_additional_rules = {
9697
ingress_self_all = {
9798
description = "Node to node all ports/protocols"

node_groups.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,17 @@ locals {
130130
from_port = 123
131131
to_port = 123
132132
type = "egress"
133-
cidr_blocks = ["0.0.0.0/0"]
134-
ipv6_cidr_blocks = var.cluster_ip_family == "ipv6" ? ["::/0"] : null
133+
cidr_blocks = var.node_security_group_ntp_ipv4_cidr_block
134+
ipv6_cidr_blocks = var.cluster_ip_family == "ipv6" ? var.node_security_group_ntp_ipv6_cidr_block : null
135135
}
136136
egress_ntp_udp = {
137137
description = "Egress NTP/UDP to internet"
138138
protocol = "udp"
139139
from_port = 123
140140
to_port = 123
141141
type = "egress"
142-
cidr_blocks = ["0.0.0.0/0"]
143-
ipv6_cidr_blocks = var.cluster_ip_family == "ipv6" ? ["::/0"] : null
142+
cidr_blocks = var.node_security_group_ntp_ipv4_cidr_block
143+
ipv6_cidr_blocks = var.cluster_ip_family == "ipv6" ? var.node_security_group_ntp_ipv6_cidr_block : null
144144
}
145145
}
146146
}

variables.tf

+14
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,20 @@ variable "node_security_group_tags" {
322322
default = {}
323323
}
324324

325+
# TODO - at next breaking change, make 169.254.169.123/32 the default
326+
variable "node_security_group_ntp_ipv4_cidr_block" {
327+
description = "IPv4 CIDR block to allow NTP egress. Default is public IP space, but [Amazon Time Sync Service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html) can be used as well with `[\"169.254.169.123/32\"]`"
328+
type = list(string)
329+
default = ["0.0.0.0/0"]
330+
}
331+
332+
# TODO - at next breaking change, make fd00:ec2::123/128 the default
333+
variable "node_security_group_ntp_ipv6_cidr_block" {
334+
description = "IPv4 CIDR block to allow NTP egress. Default is public IP space, but [Amazon Time Sync Service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html) can be used as well with `[\"fd00:ec2::123/128\"]`"
335+
type = list(string)
336+
default = ["::/0"]
337+
}
338+
325339
################################################################################
326340
# IRSA
327341
################################################################################

0 commit comments

Comments
 (0)