Enum DeploymentStrategy
The deployment stratergy to use for ECS controller.
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum DeploymentStrategy
Syntax (vb)
Public Enum DeploymentStrategy
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda;
Cluster cluster;
TaskDefinition taskDefinition;
Function lambdaHook;
ApplicationTargetGroup blueTargetGroup;
ApplicationTargetGroup greenTargetGroup;
ApplicationListenerRule prodListenerRule;
var service = new FargateService(this, "Service", new FargateServiceProps {
Cluster = cluster,
TaskDefinition = taskDefinition,
DeploymentStrategy = DeploymentStrategy.BLUE_GREEN
});
service.AddLifecycleHook(new DeploymentLifecycleLambdaTarget(lambdaHook, "PreScaleHook", new DeploymentLifecycleLambdaTargetProps {
LifecycleStages = new [] { DeploymentLifecycleStage.PRE_SCALE_UP }
}));
var target = service.LoadBalancerTarget(new LoadBalancerTargetOptions {
ContainerName = "nginx",
ContainerPort = 80,
Protocol = Protocol.TCP,
AlternateTarget = new AlternateTarget("AlternateTarget", new AlternateTargetProps {
AlternateTargetGroup = greenTargetGroup,
ProductionListener = ListenerRuleConfiguration.ApplicationListenerRule(prodListenerRule)
})
});
target.AttachToApplicationTargetGroup(blueTargetGroup);
Synopsis
Fields
BLUE_GREEN | Blue/green deployment. |
ROLLING | Rolling update deployment. |
Fields
Name | Description |
---|---|
BLUE_GREEN | Blue/green deployment. |
ROLLING | Rolling update deployment. |