Skip to content

Commit 578920e

Browse files
authored
Merge pull request #10162 from rifelpet/nlb-sg
Fix additionalSecurityGroups support for NLB
2 parents 235133d + 860249f commit 578920e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

pkg/model/awsmodel/autoscalinggroup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (b *AutoscalingGroupModelBuilder) buildLaunchConfigurationTask(c *fi.ModelB
203203
if b.APILoadBalancerClass() == kops.LoadBalancerClassNetwork {
204204
for _, id := range b.Cluster.Spec.API.LoadBalancer.AdditionalSecurityGroups {
205205
sgTask := &awstasks.SecurityGroup{
206-
ID: fi.String("nlb-" + id),
206+
ID: fi.String(id),
207207
Lifecycle: b.SecurityLifecycle,
208208
Name: fi.String("nlb-" + id),
209209
Shared: fi.Bool(true),

tests/integration/update_cluster/complex/cloudformation.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@
271271
{
272272
"Ref": "AWSEC2SecurityGroupmasterscomplexexamplecom"
273273
},
274-
"nlb-sg-exampleid3",
275-
"nlb-sg-exampleid4"
274+
"sg-exampleid3",
275+
"sg-exampleid4"
276276
]
277277
}
278278
],
@@ -404,9 +404,9 @@
404404
{
405405
"Ref": "AWSEC2SecurityGroupnodescomplexexamplecom"
406406
},
407-
"nlb-sg-exampleid3",
408-
"nlb-sg-exampleid4",
409407
"sg-exampleid3",
408+
"sg-exampleid3",
409+
"sg-exampleid4",
410410
"sg-exampleid4"
411411
]
412412
}

tests/integration/update_cluster/complex/kubernetes.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
locals {
22
cluster_name = "complex.example.com"
33
master_autoscaling_group_ids = [aws_autoscaling_group.master-us-test-1a-masters-complex-example-com.id]
4-
master_security_group_ids = [aws_security_group.masters-complex-example-com.id, "nlb-sg-exampleid3", "nlb-sg-exampleid4"]
4+
master_security_group_ids = [aws_security_group.masters-complex-example-com.id, "sg-exampleid3", "sg-exampleid4"]
55
masters_role_arn = aws_iam_role.masters-complex-example-com.arn
66
masters_role_name = aws_iam_role.masters-complex-example-com.name
77
node_autoscaling_group_ids = [aws_autoscaling_group.nodes-complex-example-com.id]
8-
node_security_group_ids = [aws_security_group.nodes-complex-example-com.id, "nlb-sg-exampleid3", "nlb-sg-exampleid4", "sg-exampleid3", "sg-exampleid4"]
8+
node_security_group_ids = [aws_security_group.nodes-complex-example-com.id, "sg-exampleid3", "sg-exampleid3", "sg-exampleid4", "sg-exampleid4"]
99
node_subnet_ids = [aws_subnet.us-test-1a-complex-example-com.id]
1010
nodes_role_arn = aws_iam_role.nodes-complex-example-com.arn
1111
nodes_role_name = aws_iam_role.nodes-complex-example-com.name
@@ -25,7 +25,7 @@ output "master_autoscaling_group_ids" {
2525
}
2626

2727
output "master_security_group_ids" {
28-
value = [aws_security_group.masters-complex-example-com.id, "nlb-sg-exampleid3", "nlb-sg-exampleid4"]
28+
value = [aws_security_group.masters-complex-example-com.id, "sg-exampleid3", "sg-exampleid4"]
2929
}
3030

3131
output "masters_role_arn" {
@@ -41,7 +41,7 @@ output "node_autoscaling_group_ids" {
4141
}
4242

4343
output "node_security_group_ids" {
44-
value = [aws_security_group.nodes-complex-example-com.id, "nlb-sg-exampleid3", "nlb-sg-exampleid4", "sg-exampleid3", "sg-exampleid4"]
44+
value = [aws_security_group.nodes-complex-example-com.id, "sg-exampleid3", "sg-exampleid3", "sg-exampleid4", "sg-exampleid4"]
4545
}
4646

4747
output "node_subnet_ids" {
@@ -301,7 +301,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-complex-example-com" {
301301
network_interfaces {
302302
associate_public_ip_address = true
303303
delete_on_termination = true
304-
security_groups = [aws_security_group.masters-complex-example-com.id, "nlb-sg-exampleid3", "nlb-sg-exampleid4"]
304+
security_groups = [aws_security_group.masters-complex-example-com.id, "sg-exampleid3", "sg-exampleid4"]
305305
}
306306
tag_specifications {
307307
resource_type = "instance"
@@ -375,7 +375,7 @@ resource "aws_launch_template" "nodes-complex-example-com" {
375375
network_interfaces {
376376
associate_public_ip_address = true
377377
delete_on_termination = true
378-
security_groups = [aws_security_group.nodes-complex-example-com.id, "nlb-sg-exampleid3", "nlb-sg-exampleid4", "sg-exampleid3", "sg-exampleid4"]
378+
security_groups = [aws_security_group.nodes-complex-example-com.id, "sg-exampleid3", "sg-exampleid3", "sg-exampleid4", "sg-exampleid4"]
379379
}
380380
tag_specifications {
381381
resource_type = "instance"

0 commit comments

Comments
 (0)