# RolloutStrategy

Class · Stable

Defines the rollout strategy for a deployment strategy and includes the growth factor, deployment duration, growth type, and optionally final bake time.

Obtainable from: RolloutStrategy.ALL_AT_ONCE, RolloutStrategy.CANARY_10_PERCENT_20_MINUTES, RolloutStrategy.LINEAR_20_PERCENT_EVERY_6_MINUTES, RolloutStrategy.LINEAR_50_PERCENT_EVERY_30_SECONDS, RolloutStrategy.exponential, RolloutStrategy.linear

- Source: [`aws-appconfig/lib/deployment-strategy.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-appconfig/lib/deployment-strategy.ts#L299)
- Type last changed: v2.130.0 · 23 Feb 2024

## Example

TypeScript:

```ts
new appconfig.DeploymentStrategy(this, 'MyDeploymentStrategy', {
  rolloutStrategy: appconfig.RolloutStrategy.linear({
    growthFactor: 20,
    deploymentDuration: Duration.minutes(30),
    finalBakeTime: Duration.minutes(30),
  }),
});
```

Python:

```python
appconfig.DeploymentStrategy(self, "MyDeploymentStrategy",
    rollout_strategy=appconfig.RolloutStrategy.linear(
        growth_factor=20,
        deployment_duration=Duration.minutes(30),
        final_bake_time=Duration.minutes(30)
    )
)
```

Java:

```java
DeploymentStrategy.Builder.create(this, "MyDeploymentStrategy")
        .rolloutStrategy(RolloutStrategy.linear(RolloutStrategyProps.builder()
                .growthFactor(20)
                .deploymentDuration(Duration.minutes(30))
                .finalBakeTime(Duration.minutes(30))
                .build()))
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
new DeploymentStrategy(this, "MyDeploymentStrategy", new DeploymentStrategyProps {
    RolloutStrategy = RolloutStrategy.Linear(new RolloutStrategyProps {
        GrowthFactor = 20,
        DeploymentDuration = Duration.Minutes(30),
        FinalBakeTime = Duration.Minutes(30)
    })
});
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
appconfig.NewDeploymentStrategy(this, jsii.String("MyDeploymentStrategy"), &DeploymentStrategyProps{
	RolloutStrategy: appconfig.RolloutStrategy_Linear(&RolloutStrategyProps{
		GrowthFactor: jsii.Number(20),
		DeploymentDuration: awscdk.Duration_Minutes(jsii.Number(30)),
		FinalBakeTime: awscdk.Duration_*Minutes(jsii.Number(30)),
	}),
})
```

## Initializer

TypeScript:

```ts
new RolloutStrategy()
```

Python:

```python
RolloutStrategy()
```

Java:

```java
new RolloutStrategy()
```

C#:

```csharp
new RolloutStrategy()
```

Go:

```go
NewRolloutStrategy()
```

## Properties

- `ALL_AT_ONCE`: [RolloutStrategy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.RolloutStrategy.html) (static) — **Quick**.

  This strategy deploys the configuration to all targets immediately.

- `CANARY_10_PERCENT_20_MINUTES`: [RolloutStrategy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.RolloutStrategy.html) (static) — **AWS Recommended**.

  This strategy processes the deployment exponentially using a 10% growth factor over 20 minutes.
  AWS AppConfig recommends using this strategy for production deployments because it aligns with AWS best practices
  for configuration deployments.

- `deploymentDuration`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The deployment duration of the rollout strategy.

- `finalBakeTime`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The final bake time of the deployment strategy.

- `growthFactor`: number — The growth factor of the rollout strategy.

- `growthType`: [GrowthType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.GrowthType.html) — The growth type of the rollout strategy.

- `LINEAR_20_PERCENT_EVERY_6_MINUTES`: [RolloutStrategy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.RolloutStrategy.html) (static) — **AWS Recommended**.

  This strategy deploys the configuration to 20% of all targets every six minutes for a 30 minute deployment.
  AWS AppConfig recommends using this strategy for production deployments because it aligns with AWS best practices
  for configuration deployments.

- `LINEAR_50_PERCENT_EVERY_30_SECONDS`: [RolloutStrategy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.RolloutStrategy.html) (static) — **Testing/Demonstration**.

  This strategy deploys the configuration to half of all targets every 30 seconds for a
  one-minute deployment. AWS AppConfig recommends using this strategy only for testing or demonstration purposes because
  it has a short duration and bake time.

## Methods

- `exponential(props: RolloutStrategyProps): RolloutStrategy // chainable` (static) — Build your own exponential rollout strategy.

- `linear(props: RolloutStrategyProps): RolloutStrategy // chainable` (static) — Build your own linear rollout strategy.
