Skip to content

Commit

Permalink
fix(aws-ecs): expose readonly service on LoadBalancedEc2Service (#2395)
Browse files Browse the repository at this point in the history
Fixes #2378.
  • Loading branch information
SoManyHs authored and rix0rrr committed May 6, 2019
1 parent 3bfc641 commit 52af870
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/@aws-cdk/aws-ecs/lib/load-balanced-ecs-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export interface LoadBalancedEc2ServiceProps extends LoadBalancedServiceBaseProp
* A single task running on an ECS cluster fronted by a load balancer
*/
export class LoadBalancedEc2Service extends LoadBalancedServiceBase {

/**
* The ECS service in this construct
*/
public readonly service: Ec2Service;

constructor(scope: cdk.Construct, id: string, props: LoadBalancedEc2ServiceProps) {
super(scope, id, props);

Expand All @@ -56,6 +62,7 @@ export class LoadBalancedEc2Service extends LoadBalancedServiceBase {
taskDefinition
});

this.service = service;
this.addServiceAsTarget(service);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export interface LoadBalancedFargateServiceProps extends LoadBalancedServiceBase
*/
export class LoadBalancedFargateService extends LoadBalancedServiceBase {

/**
* The Fargate service in this construct
*/
public readonly service: FargateService;

constructor(scope: cdk.Construct, id: string, props: LoadBalancedFargateServiceProps) {
Expand Down

0 comments on commit 52af870

Please sign in to comment.