Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(elbv2): use correct prop for TargetGroup name #1684

Merged
merged 1 commit into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export abstract class TargetGroupBase extends cdk.Construct implements ITargetGr
this.targetType = baseProps.targetType;

this.resource = new CfnTargetGroup(this, 'Resource', {
targetGroupName: baseProps.targetGroupName,
name: baseProps.targetGroupName,
targetGroupAttributes: new cdk.Token(() => renderAttributes(this.attributes)),
targetType: new cdk.Token(() => this.targetType),
targets: new cdk.Token(() => this.targetsJson),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@ export = {
test.done();
},

'Can configure name on TargetGroups'(test: Test) {
// GIVEN
const stack = new cdk.Stack();
const vpc = new ec2.VpcNetwork(stack, 'Stack');

// WHEN
new elbv2.ApplicationTargetGroup(stack, 'TargetGroup', {
vpc,
port: 80,
targetGroupName: 'foo'
});

// THEN
expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::TargetGroup', {
Name: 'foo'
}));

test.done();
},

'Can add target groups with and without conditions'(test: Test) {
// GIVEN
const stack = new cdk.Stack();
Expand Down