@@ -145,20 +145,31 @@ func (c *associationController) reconcileLbSG(ctx context.Context, ingressKey ty
145
145
Description : aws .String (fmt .Sprintf ("Allow ingress on port %v from %v" , port , cidr )),
146
146
})
147
147
}
148
+
148
149
ipv6Ranges := make ([]* ec2.Ipv6Range , 0 , len (cfg .LbInboundV6CIDRs ))
149
150
for _ , cidr := range cfg .LbInboundV6CIDRs {
150
151
ipv6Ranges = append (ipv6Ranges , & ec2.Ipv6Range {
151
152
CidrIpv6 : aws .String (cidr ),
152
153
Description : aws .String (fmt .Sprintf ("Allow ingress on port %v from %v" , port , cidr )),
153
154
})
154
155
}
156
+
157
+ if len (ipv6Ranges ) > 0 {
158
+ inboundPermissions = append (inboundPermissions , & ec2.IpPermission {
159
+ IpProtocol : aws .String ("tcp" ),
160
+ FromPort : aws .Int64 (port ),
161
+ ToPort : aws .Int64 (port ),
162
+ Ipv6Ranges : ipv6Ranges ,
163
+ })
164
+ }
165
+
155
166
permission := & ec2.IpPermission {
156
167
IpProtocol : aws .String ("tcp" ),
157
168
FromPort : aws .Int64 (port ),
158
169
ToPort : aws .Int64 (port ),
159
170
IpRanges : ipRanges ,
160
- Ipv6Ranges : ipv6Ranges ,
161
171
}
172
+
162
173
inboundPermissions = append (inboundPermissions , permission )
163
174
}
164
175
if err := c .sgController .Reconcile (ctx , sgInstance , inboundPermissions , sgTags ); err != nil {
0 commit comments