1
1
import autoscaling = require( '@aws-cdk/aws-autoscaling' ) ;
2
2
import cloudwatch = require( '@aws-cdk/aws-cloudwatch' ) ;
3
- import codedeploylb = require( '@aws-cdk/aws-codedeploy-api' ) ;
4
3
import ec2 = require( '@aws-cdk/aws-ec2' ) ;
5
4
import iam = require( '@aws-cdk/aws-iam' ) ;
6
5
import s3 = require( '@aws-cdk/aws-s3' ) ;
@@ -10,6 +9,7 @@ import { AutoRollbackConfig } from '../rollback-config';
10
9
import { arnForDeploymentGroup , renderAlarmConfiguration , renderAutoRollbackConfiguration } from '../utils' ;
11
10
import { IServerApplication , ServerApplication } from './application' ;
12
11
import { IServerDeploymentConfig , ServerDeploymentConfig } from './deployment-config' ;
12
+ import { LoadBalancer , LoadBalancerGeneration } from './load-balancer' ;
13
13
14
14
export interface IServerDeploymentGroup extends cdk . IResource {
15
15
readonly application : IServerApplication ;
@@ -190,12 +190,12 @@ export interface ServerDeploymentGroupProps {
190
190
191
191
/**
192
192
* The load balancer to place in front of this Deployment Group.
193
- * Can be either a classic Elastic Load Balancer,
193
+ * Can be created from either a classic Elastic Load Balancer,
194
194
* or an Application Load Balancer / Network Load Balancer Target Group.
195
195
*
196
196
* @default the Deployment Group will not have a load balancer defined
197
197
*/
198
- readonly loadBalancer ?: codedeploylb . ILoadBalancer ;
198
+ readonly loadBalancer ?: LoadBalancer ;
199
199
200
200
/**
201
201
* All EC2 instances matching the given set of tags when a deployment occurs will be added to this Deployment Group.
@@ -387,25 +387,23 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase {
387
387
}
388
388
}
389
389
390
- private loadBalancerInfo ( lbProvider ?: codedeploylb . ILoadBalancer ) :
390
+ private loadBalancerInfo ( loadBalancer ?: LoadBalancer ) :
391
391
CfnDeploymentGroup . LoadBalancerInfoProperty | undefined {
392
- if ( ! lbProvider ) {
392
+ if ( ! loadBalancer ) {
393
393
return undefined ;
394
394
}
395
395
396
- const lb = lbProvider . asCodeDeployLoadBalancer ( ) ;
397
-
398
- switch ( lb . generation ) {
399
- case codedeploylb . LoadBalancerGeneration . First :
396
+ switch ( loadBalancer . generation ) {
397
+ case LoadBalancerGeneration . FIRST :
400
398
return {
401
399
elbInfoList : [
402
- { name : lb . name } ,
400
+ { name : loadBalancer . name } ,
403
401
] ,
404
402
} ;
405
- case codedeploylb . LoadBalancerGeneration . Second :
403
+ case LoadBalancerGeneration . SECOND :
406
404
return {
407
405
targetGroupInfoList : [
408
- { name : lb . name } ,
406
+ { name : loadBalancer . name } ,
409
407
]
410
408
} ;
411
409
}
0 commit comments