-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(elbv2): fix disabling proxy protocol v2 attribute for NetworkTarg…
- Loading branch information
1 parent
203a605
commit 8b598c4
Showing
2 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.target-group.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { expect, haveResource } from '@aws-cdk/assert'; | ||
import cdk = require('@aws-cdk/core'); | ||
import { Test } from 'nodeunit'; | ||
import elbv2 = require('../../lib'); | ||
|
||
export = { | ||
'Enable proxy protocol v2 attribute for target group'(test: Test) { | ||
// GIVEN | ||
const stack = new cdk.Stack(); | ||
|
||
// WHEN | ||
new elbv2.NetworkTargetGroup(stack, 'Group', { | ||
port: 80, | ||
proxyProtocolV2: true | ||
}); | ||
|
||
// THEN | ||
expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::TargetGroup', { | ||
TargetGroupAttributes: [ | ||
{ | ||
Key: 'proxy_protocol_v2.enabled', | ||
Value: 'true' | ||
} | ||
] | ||
})); | ||
|
||
test.done(); | ||
}, | ||
|
||
'Disable proxy protocol v2 for attribute target group'(test: Test) { | ||
// GIVEN | ||
const stack = new cdk.Stack(); | ||
|
||
// WHEN | ||
new elbv2.NetworkTargetGroup(stack, 'Group', { | ||
port: 80, | ||
proxyProtocolV2: false | ||
}); | ||
|
||
// THEN | ||
expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::TargetGroup', { | ||
TargetGroupAttributes: [ | ||
{ | ||
Key: 'proxy_protocol_v2.enabled', | ||
Value: 'false' | ||
} | ||
] | ||
})); | ||
|
||
test.done(); | ||
}, | ||
}; |