# Wave

Multiple stages that are deployed in parallel.

Returned by: [PipelineBase.addWave](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.PipelineBase.html#addwave)

- Source: [`pipelines/lib/blueprint/wave.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/pipelines/lib/blueprint/wave.ts#L27)

## Example

TypeScript:

```ts
declare const pipeline: pipelines.CodePipeline;
const europeWave = pipeline.addWave('Europe');
europeWave.addStage(
  new MyApplicationStage(this, 'Ireland', {
    env: { region: 'eu-west-1' },
  })
);
europeWave.addStage(
  new MyApplicationStage(this, 'Germany', {
    env: { region: 'eu-central-1' },
  })
);
```

Python:

```python
# pipeline: pipelines.CodePipeline

europe_wave = pipeline.add_wave("Europe")
europe_wave.add_stage(
    MyApplicationStage(self, "Ireland",
        env=cdk.Environment(region="eu-west-1")
    ))
europe_wave.add_stage(
    MyApplicationStage(self, "Germany",
        env=cdk.Environment(region="eu-central-1")
    ))
```

Java:

```java
CodePipeline pipeline;

Wave europeWave = pipeline.addWave("Europe");
europeWave.addStage(
MyApplicationStage.Builder.create(this, "Ireland")
        .env(Environment.builder().region("eu-west-1").build())
        .build());
europeWave.addStage(
MyApplicationStage.Builder.create(this, "Germany")
        .env(Environment.builder().region("eu-central-1").build())
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
CodePipeline pipeline;

var europeWave = pipeline.AddWave("Europe");
europeWave.AddStage(
new MyApplicationStage(this, "Ireland", new StageProps {
    Env = new Environment { Region = "eu-west-1" }
}));
europeWave.AddStage(
new MyApplicationStage(this, "Germany", new StageProps {
    Env = new Environment { Region = "eu-central-1" }
}));
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var pipeline CodePipeline

europeWave := pipeline.AddWave(jsii.String("Europe"))
europeWave.AddStage(
newMyApplicationStage(this, jsii.String("Ireland"), &StageProps{
	Env: &Environment{
		Region: jsii.String("eu-west-1"),
	},
}))
europeWave.AddStage(
newMyApplicationStage(this, jsii.String("Germany"), &StageProps{
	Env: &Environment{
		Region: jsii.String("eu-central-1"),
	},
}))
```

## Initializer

TypeScript:

```ts
new Wave(id: string, props?: WaveProps)
```

Python:

```python
Wave(id: str, props: typing.Optional[WaveProps] = None)
```

Java:

```java
new Wave(String id, WaveProps props)
```

C# / .NET:

```csharp
new Wave(string id, WaveProps? props = null)
```

Golang:

```go
NewWave(Id *string, Props WaveProps)
```

## Properties

- `id`: string — Identifier for this Wave.

- `post`: [Step](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.Step.html)[] — Additional steps that are run after all of the stages in the wave.

- `pre`: [Step](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.Step.html)[] — Additional steps that are run before any of the stages in the wave.

- `stages`: [StageDeployment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.StageDeployment.html)[] — The stages that are deployed in this wave.

## Methods

- `addPost(...steps: Step[]): void` — Add an additional step to run after all of the stages in this wave.

- `addPre(...steps: Step[]): void` — Add an additional step to run before any of the stages in this wave.

- `addStage(stage: Stage, options?: AddStageOpts): StageDeployment` — Add a Stage to this wave.

  It will be deployed in parallel with all other stages in this
  wave.
