Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 174bf2d

Browse files
committed
Fix resource tags and security groups
Signed-off-by: JoshVanL <[email protected]>
1 parent db10cbf commit 174bf2d

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

demo/infrastructure/modules/amazon-cluster/security_groups.tf

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ resource "aws_security_group" "cluster-node" {
3636
cidr_blocks = ["0.0.0.0/0"]
3737
}
3838

39-
tags = {
40-
Name = "cluster-${var.suffix}"
41-
42-
"kubernetes.io/cluster/cluster-${var.suffix}" = "owned"
43-
}
39+
tags = "${
40+
map(
41+
"Name", "cluster-${var.suffix}",
42+
"kubernetes.io/cluster/cluster-${var.suffix}", "owned",
43+
)
44+
}"
4445
}
4546

4647
resource "aws_security_group_rule" "cluster-node-ingress-self" {
@@ -58,11 +59,20 @@ resource "aws_security_group_rule" "cluster-node-ingress-cluster" {
5859
from_port = 1025
5960
protocol = "tcp"
6061
security_group_id = "${aws_security_group.cluster-node.id}"
61-
source_security_group_id = "${aws_security_group.cluster-node.id}"
62+
source_security_group_id = "${aws_security_group.cluster.id}"
6263
to_port = 65535
6364
type = "ingress"
6465
}
6566

67+
resource "aws_security_group_rule" "cluster-ingress-node-https" {
68+
description = "Allow pods to communicate with the cluster API Server"
69+
from_port = 443
70+
protocol = "tcp"
71+
security_group_id = "${aws_security_group.cluster.id}"
72+
source_security_group_id = "${aws_security_group.cluster-node.id}"
73+
to_port = 443
74+
type = "ingress"
75+
}
6676

6777
resource "aws_security_group_rule" "cluster-ingress-workstation-https" {
6878
cidr_blocks = ["${local.workstation-external-cidr}"]

demo/infrastructure/modules/amazon-cluster/vpc.tf

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ data "aws_availability_zones" "available" {}
33
resource "aws_vpc" "cluster" {
44
cidr_block = "10.0.0.0/16"
55

6-
tags = {
7-
Name = "cluster-${var.suffix}"
8-
9-
"kubernetes.io/cluster/cluster-${var.suffix}" = "shared"
10-
}
6+
tags = "${
7+
map(
8+
"Name", "cluster-${var.suffix}",
9+
"kubernetes.io/cluster/cluster-${var.suffix}", "shared",
10+
)
11+
}"
1112
}
1213

1314
resource "aws_subnet" "cluster" {
@@ -17,11 +18,12 @@ resource "aws_subnet" "cluster" {
1718
cidr_block = "10.0.${count.index}.0/24"
1819
vpc_id = "${aws_vpc.cluster.id}"
1920

20-
tags = {
21-
Name = "cluster-${var.suffix}"
22-
23-
"kubernetes.io/cluster/cluster-${var.suffix}" = "shared"
24-
}
21+
tags = "${
22+
map(
23+
"Name", "cluster-${var.suffix}",
24+
"kubernetes.io/cluster/cluster-${var.suffix}", "shared",
25+
)
26+
}"
2527
}
2628

2729
resource "aws_internet_gateway" "cluster" {

0 commit comments

Comments
 (0)