Skip to content

Commit

Permalink
chore(elasticloadbalancingv2): fix failing integ test (aws#21583)
Browse files Browse the repository at this point in the history
The test was failing due to the IP Target not being behind a subnet. This corrects that.


----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
TheRealAmazonKendra authored Aug 12, 2022
1 parent b777878 commit fbed1e0
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import * as ec2 from '@aws-cdk/aws-ec2';
import * as cdk from '@aws-cdk/core';
import * as integ from '@aws-cdk/integ-tests';
import * as elbv2 from '../lib';

const app = new cdk.App();
Expand All @@ -24,8 +24,13 @@ const group = listener.addTargets('Target', {
targets: [new elbv2.IpTarget('10.0.1.1')],
});

vpc.publicSubnets.forEach(subnet => group.node.addDependency(subnet));
group.node.addDependency(vpc.internetConnectivityEstablished);

// The target's security group must allow being routed by the LB and the clients.

new integ.IntegTest(app, 'elbv2-integ', {
testCases: [stack],
});

app.synth();
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,19 @@
}
},
"DependsOn": [
"VPCIGWB7E252D3"
"VPCIGWB7E252D3",
"VPCPublicSubnet1DefaultRoute91CEF279",
"VPCPublicSubnet1EIP6AD938E8",
"VPCPublicSubnet1NATGatewayE0556630",
"VPCPublicSubnet1RouteTableFEE4B781",
"VPCPublicSubnet1RouteTableAssociation0B0896DC",
"VPCPublicSubnet1SubnetB4246D30",
"VPCPublicSubnet2DefaultRouteB7481BBA",
"VPCPublicSubnet2EIP4947BC00",
"VPCPublicSubnet2NATGateway3C070193",
"VPCPublicSubnet2RouteTable6F1A15F1",
"VPCPublicSubnet2RouteTableAssociation5A808732",
"VPCPublicSubnet2Subnet74179F39"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"version": "20.0.0",
"testCases": {
"integ.nlb": {
"elbv2-integ/DefaultTest": {
"stacks": [
"aws-cdk-elbv2-integ"
],
"diffAssets": false,
"stackUpdateWorkflow": true
"assertionStack": "elbv2integDefaultTestDeployAssert6120E394"
}
},
"synthContext": {},
"enableLookups": false
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down Expand Up @@ -173,6 +173,15 @@
]
},
"displayName": "aws-cdk-elbv2-integ"
},
"elbv2integDefaultTestDeployAssert6120E394": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "elbv2integDefaultTestDeployAssert6120E394.template.json",
"validateOnSynth": false
},
"displayName": "elbv2-integ/DefaultTest/DeployAssert"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"id": "Tree",
"path": "Tree",
"constructInfo": {
"fqn": "@aws-cdk/core.Construct",
"version": "0.0.0"
"fqn": "constructs.Construct",
"version": "10.1.71"
}
},
"aws-cdk-elbv2-integ": {
Expand Down Expand Up @@ -773,6 +773,42 @@
"fqn": "@aws-cdk/core.Stack",
"version": "0.0.0"
}
},
"elbv2-integ": {
"id": "elbv2-integ",
"path": "elbv2-integ",
"children": {
"DefaultTest": {
"id": "DefaultTest",
"path": "elbv2-integ/DefaultTest",
"children": {
"Default": {
"id": "Default",
"path": "elbv2-integ/DefaultTest/Default",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.71"
}
},
"DeployAssert": {
"id": "DeployAssert",
"path": "elbv2-integ/DefaultTest/DeployAssert",
"constructInfo": {
"fqn": "@aws-cdk/core.Stack",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/integ-tests.IntegTestCase",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/integ-tests.IntegTest",
"version": "0.0.0"
}
}
},
"constructInfo": {
Expand Down

0 comments on commit fbed1e0

Please sign in to comment.