File tree 2 files changed +21
-1
lines changed
packages/@aws-cdk/aws-elasticloadbalancingv2
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ export abstract class TargetGroupBase extends cdk.Construct implements ITargetGr
213
213
this . targetType = baseProps . targetType ;
214
214
215
215
this . resource = new CfnTargetGroup ( this , 'Resource' , {
216
- targetGroupName : baseProps . targetGroupName ,
216
+ name : baseProps . targetGroupName ,
217
217
targetGroupAttributes : new cdk . Token ( ( ) => renderAttributes ( this . attributes ) ) ,
218
218
targetType : new cdk . Token ( ( ) => this . targetType ) ,
219
219
targets : new cdk . Token ( ( ) => this . targetsJson ) ,
Original file line number Diff line number Diff line change @@ -114,6 +114,26 @@ export = {
114
114
test . done ( ) ;
115
115
} ,
116
116
117
+ 'Can configure name on TargetGroups' ( test : Test ) {
118
+ // GIVEN
119
+ const stack = new cdk . Stack ( ) ;
120
+ const vpc = new ec2 . VpcNetwork ( stack , 'Stack' ) ;
121
+
122
+ // WHEN
123
+ new elbv2 . ApplicationTargetGroup ( stack , 'TargetGroup' , {
124
+ vpc,
125
+ port : 80 ,
126
+ targetGroupName : 'foo'
127
+ } ) ;
128
+
129
+ // THEN
130
+ expect ( stack ) . to ( haveResource ( 'AWS::ElasticLoadBalancingV2::TargetGroup' , {
131
+ Name : 'foo'
132
+ } ) ) ;
133
+
134
+ test . done ( ) ;
135
+ } ,
136
+
117
137
'Can add target groups with and without conditions' ( test : Test ) {
118
138
// GIVEN
119
139
const stack = new cdk . Stack ( ) ;
You can’t perform that action at this time.
0 commit comments