From 41beff1d9d605a22b26597f00f039602cafd57d2 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Wed, 6 Oct 2021 09:46:43 -0700 Subject: [PATCH] eks/cluster/vpc: tag subnets with cluster name Signed-off-by: Gyuho Lee --- eks/cluster/vpc.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eks/cluster/vpc.go b/eks/cluster/vpc.go index c82e5028c..4637ee02c 100644 --- a/eks/cluster/vpc.go +++ b/eks/cluster/vpc.go @@ -643,6 +643,11 @@ func (ts *tester) createPublicSubnets() error { Key: aws_v2.String("kubernetes.io/role/internal-elb"), Value: aws_v2.String("1"), }, + { + // https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.htmls + Key: aws_v2.String(fmt.Sprintf("kubernetes.io/cluster/%s", ts.cfg.EKSConfig.Name)), + Value: aws_v2.String("owned"), + }, }, }, }, @@ -1171,6 +1176,11 @@ func (ts *tester) createPrivateSubnets() error { Key: aws_v2.String("Network"), Value: aws_v2.String("Private"), }, + { + // https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.htmls + Key: aws_v2.String(fmt.Sprintf("kubernetes.io/cluster/%s", ts.cfg.EKSConfig.Name)), + Value: aws_v2.String("owned"), + }, }, }, },