Skip to content

Commit 6c790fd

Browse files
authored
revert: "fix(elasticloadbalancingv2): open, dual-stack-without-public-ipv4 ALB allows IPv6 inbound traffic" (#32690)
Reverts #32203 We should make this change under a "fix" feature flag as to not break existing customers
1 parent 032964b commit 6c790fd

File tree

10 files changed

+12
-65
lines changed

10 files changed

+12
-65
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.dualstack-without-public-ipv4.js.snapshot/AlbDualstackWithoutPublicIpv4DefaultTestDeployAssertFA6F90DD.assets.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.dualstack-without-public-ipv4.js.snapshot/aws-cdk-elbv2-integ-dualstack-without-public-ipv4.assets.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.dualstack-without-public-ipv4.js.snapshot/aws-cdk-elbv2-integ-dualstack-without-public-ipv4.template.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,6 @@
530530
"FromPort": 80,
531531
"IpProtocol": "tcp",
532532
"ToPort": 80
533-
},
534-
{
535-
"CidrIpv6": "::/0",
536-
"Description": "Allow from anyone on port 80",
537-
"FromPort": 80,
538-
"IpProtocol": "tcp",
539-
"ToPort": 80
540533
}
541534
],
542535
"VpcId": {

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.dualstack-without-public-ipv4.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.dualstack-without-public-ipv4.js.snapshot/integ.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.dualstack-without-public-ipv4.js.snapshot/manifest.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.alb.dualstack-without-public-ipv4.js.snapshot/tree.json

Lines changed: 2 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,13 @@ const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', {
298298
});
299299
```
300300

301-
By setting `DUAL_STACK_WITHOUT_PUBLIC_IPV4`, you can provision load balancers without public IPv4s:
301+
By setting `DUAL_STACK_WITHOUT_PUBLIC_IPV4`, you can provision load balancers without public IPv4s
302302

303303
```ts
304304
declare const vpc: ec2.Vpc;
305305

306306
const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', {
307307
vpc,
308-
internetFacing: true,
309308
ipAddressType: elbv2.IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4,
310309
});
311310
```

packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,7 @@ export class ApplicationListener extends BaseListener implements IApplicationLis
303303

304304
if (props.open !== false) {
305305
this.connections.allowDefaultPortFrom(ec2.Peer.anyIpv4(), `Allow from anyone on port ${port}`);
306-
if (this.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK ||
307-
this.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4) {
306+
if (this.loadBalancer.ipAddressType === IpAddressType.DUAL_STACK) {
308307
this.connections.allowDefaultPortFrom(ec2.Peer.anyIpv6(), `Allow from anyone on port ${port}`);
309308
}
310309
}

packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/alb/listener.test.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -107,43 +107,6 @@ describe('tests', () => {
107107
});
108108
});
109109

110-
test('Listener default to open - IPv6 (dual stack without public IPV4)', () => {
111-
// GIVEN
112-
const stack = new cdk.Stack();
113-
const vpc = new ec2.Vpc(stack, 'Stack');
114-
const loadBalancer = new elbv2.ApplicationLoadBalancer(stack, 'LB', {
115-
vpc,
116-
internetFacing: true,
117-
ipAddressType: elbv2.IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4,
118-
});
119-
120-
// WHEN
121-
loadBalancer.addListener('MyListener', {
122-
port: 80,
123-
defaultTargetGroups: [new elbv2.ApplicationTargetGroup(stack, 'Group', { vpc, port: 80 })],
124-
});
125-
126-
// THEN
127-
Template.fromStack(stack).hasResourceProperties('AWS::EC2::SecurityGroup', {
128-
SecurityGroupIngress: [
129-
{
130-
Description: 'Allow from anyone on port 80',
131-
CidrIp: '0.0.0.0/0',
132-
FromPort: 80,
133-
IpProtocol: 'tcp',
134-
ToPort: 80,
135-
},
136-
{
137-
Description: 'Allow from anyone on port 80',
138-
CidrIpv6: '::/0',
139-
FromPort: 80,
140-
IpProtocol: 'tcp',
141-
ToPort: 80,
142-
},
143-
],
144-
});
145-
});
146-
147110
test('HTTPS listener requires certificate', () => {
148111
// GIVEN
149112
const stack = new cdk.Stack();

0 commit comments

Comments
 (0)