-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(codedeploy): change the load balancer API in server Deployment Gr…
…oup. (#2548) BREAKING CHANGE: the type of the `loadBalancer` property in ServerDeploymentGroupProps has been changed. Fixes #2449
- Loading branch information
Showing
17 changed files
with
104 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
## AWS CodeDeploy Load Balancing API | ||
|
||
This package contains the abstract API of Load Balancers | ||
as required by the AWS CodeDeploy Construct Library. | ||
|
||
You should never need to depend on it directly - | ||
instead, depend on the `aws-codedeploy` package. | ||
This package has been deprecated, | ||
and will be removed in a future release of the Cloud Development Kit. | ||
Please remove if from your dependencies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
export * from './load-balancer'; | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './application'; | ||
export * from './deployment-config'; | ||
export * from './deployment-group'; | ||
export * from './load-balancer'; |
69 changes: 69 additions & 0 deletions
69
packages/@aws-cdk/aws-codedeploy/lib/server/load-balancer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import elb = require('@aws-cdk/aws-elasticloadbalancing'); | ||
import elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2'); | ||
|
||
/** | ||
* The generations of AWS load balancing solutions. | ||
*/ | ||
export enum LoadBalancerGeneration { | ||
/** | ||
* The first generation (ELB Classic). | ||
*/ | ||
FIRST = 0, | ||
|
||
/** | ||
* The second generation (ALB and NLB). | ||
*/ | ||
SECOND = 1 | ||
} | ||
|
||
/** | ||
* An interface of an abstract load balancer, as needed by CodeDeploy. | ||
* Create instances using the static factory methods: | ||
* {@link #classic}, {@link #application} and {@link #network}. | ||
*/ | ||
export abstract class LoadBalancer { | ||
/** | ||
* Creates a new CodeDeploy load balancer from a Classic ELB Load Balancer. | ||
* | ||
* @param loadBalancer a classic ELB Load Balancer | ||
*/ | ||
public static classic(loadBalancer: elb.LoadBalancer): LoadBalancer { | ||
class ClassicLoadBalancer extends LoadBalancer { | ||
public readonly generation = LoadBalancerGeneration.FIRST; | ||
public readonly name = loadBalancer.loadBalancerName; | ||
} | ||
|
||
return new ClassicLoadBalancer(); | ||
} | ||
|
||
/** | ||
* Creates a new CodeDeploy load balancer from an Application Load Balancer Target Group. | ||
* | ||
* @param albTargetGroup an ALB Target Group | ||
*/ | ||
public static application(albTargetGroup: elbv2.ApplicationTargetGroup): LoadBalancer { | ||
class AlbLoadBalancer extends LoadBalancer { | ||
public readonly generation = LoadBalancerGeneration.SECOND; | ||
public readonly name = albTargetGroup.targetGroupName; | ||
} | ||
|
||
return new AlbLoadBalancer(); | ||
} | ||
|
||
/** | ||
* Creates a new CodeDeploy load balancer from a Network Load Balancer Target Group. | ||
* | ||
* @param nlbTargetGroup an NLB Target Group | ||
*/ | ||
public static network(nlbTargetGroup: elbv2.NetworkTargetGroup): LoadBalancer { | ||
class NlbLoadBalancer extends LoadBalancer { | ||
public readonly generation = LoadBalancerGeneration.SECOND; | ||
public readonly name = nlbTargetGroup.targetGroupName; | ||
} | ||
|
||
return new NlbLoadBalancer(); | ||
} | ||
|
||
public abstract readonly generation: LoadBalancerGeneration; | ||
public abstract readonly name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 1 addition & 6 deletions
7
packages/@aws-cdk/aws-elasticloadbalancingv2/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.