# DeploymentStrategy

The deployment stratergy to use for ECS controller.

- Source: [`aws-ecs/lib/base/base-service.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts#L2188)
- Type last changed: v2.236.0 · 23 Jan 2026

## Example

```ts
declare const cluster: ecs.Cluster;
declare const taskDefinition: ecs.TaskDefinition;
declare const blueTargetGroup: elbv2.ApplicationTargetGroup;
declare const greenTargetGroup: elbv2.ApplicationTargetGroup;
declare const prodListenerRule: elbv2.ApplicationListenerRule;

const service = new ecs.FargateService(this, 'Service', {
  cluster,
  taskDefinition,
  deploymentStrategy: ecs.DeploymentStrategy.LINEAR,
  linearConfiguration: {
    stepPercent: 10.0,
    stepBakeTime: Duration.minutes(5),
  },
});

const target = service.loadBalancerTarget({
  containerName: 'web',
  containerPort: 80,
  alternateTarget: new ecs.AlternateTarget('AlternateTarget', {
    alternateTargetGroup: greenTargetGroup,
    productionListener: ecs.ListenerRuleConfiguration.applicationListenerRule(prodListenerRule),
  }),
});

target.attachToApplicationTargetGroup(blueTargetGroup);
```

## Members

| Member | Description |
| --- | --- |
| `ROLLING` | Rolling update deployment. |
| `BLUE_GREEN` | Blue/green deployment. |
| `LINEAR` | Linear deployment with progressive traffic shifting. |
| `CANARY` | Canary deployment with fixed traffic percentage testing. |

## Referenced by

- [`BaseServiceOptions`](/v2/docs/aws-cdk-lib.aws_ecs.BaseServiceOptions).deploymentStrategy
