File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/@aws-cdk/aws-ecs/lib Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ export interface LoadBalancedFargateServiceProps {
109
109
export class LoadBalancedFargateService extends cdk . Construct {
110
110
public readonly loadBalancer : elbv2 . ApplicationLoadBalancer ;
111
111
112
+ public readonly targetGroup : elbv2 . ApplicationTargetGroup ;
113
+
114
+ public readonly service : FargateService ;
115
+
112
116
constructor ( parent : cdk . Construct , id : string , props : LoadBalancedFargateServiceProps ) {
113
117
super ( parent , id ) ;
114
118
@@ -132,6 +136,7 @@ export class LoadBalancedFargateService extends cdk.Construct {
132
136
taskDefinition,
133
137
assignPublicIp
134
138
} ) ;
139
+ this . service = service ;
135
140
136
141
const internetFacing = props . publicLoadBalancer !== undefined ? props . publicLoadBalancer : true ;
137
142
const lb = new elbv2 . ApplicationLoadBalancer ( this , 'LB' , {
@@ -152,7 +157,7 @@ export class LoadBalancedFargateService extends cdk.Construct {
152
157
listener = lb . addListener ( 'PublicListener' , { port : 80 , open : true } ) ;
153
158
}
154
159
155
- listener . addTargets ( 'ECS' , {
160
+ this . targetGroup = listener . addTargets ( 'ECS' , {
156
161
port : 80 ,
157
162
targets : [ service ]
158
163
} ) ;
You can’t perform that action at this time.
0 commit comments