Skip to content
v2.278.0

WaveOptions Struct ​

Options to pass to addWave.

Example ​

ts
const pipeline = new pipelines.CodePipeline(this, 'Pipeline', {
  synth: new pipelines.ShellStep('Synth', {
    input: pipelines.CodePipelineSource.connection('my-org/my-app', 'main', {
      connectionArn:
        'arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41', // Created using the AWS console * });',
    }),
    commands: ['npm ci', 'npm run build', 'npx cdk synth'],
  }),

  // Turn this on because the pipeline uses Docker image assets
  dockerEnabledForSelfMutation: true,
});

pipeline.addWave('MyWave', {
  post: [
    new pipelines.CodeBuildStep('RunApproval', {
      commands: ['command-from-image'],
      buildEnvironment: {
        // The user of a Docker image asset in the pipeline requires turning on
        // 'dockerEnabledForSelfMutation'.
        buildImage: codebuild.LinuxBuildImage.fromAsset(this, 'Image', {
          directory: './docker-image',
        }),
      },
    }),
  ],
});
python
pipeline = pipelines.CodePipeline(self, "Pipeline",
    synth=pipelines.ShellStep("Synth",
        input=pipelines.CodePipelineSource.connection("my-org/my-app", "main",
            connection_arn="arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41"
        ),
        commands=["npm ci", "npm run build", "npx cdk synth"]
    ),

    # Turn this on because the pipeline uses Docker image assets
    docker_enabled_for_self_mutation=True
)

pipeline.add_wave("MyWave",
    post=[
        pipelines.CodeBuildStep("RunApproval",
            commands=["command-from-image"],
            build_environment=codebuild.BuildEnvironment(
                # The user of a Docker image asset in the pipeline requires turning on
                # 'dockerEnabledForSelfMutation'.
                build_image=codebuild.LinuxBuildImage.from_asset(self, "Image",
                    directory="./docker-image"
                )
            )
        )
    ]
)
java
CodePipeline pipeline = CodePipeline.Builder.create(this, "Pipeline")
        .synth(ShellStep.Builder.create("Synth")
                .input(CodePipelineSource.connection("my-org/my-app", "main", ConnectionSourceOptions.builder()
                        .connectionArn("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41")
                        .build()))
                .commands(List.of("npm ci", "npm run build", "npx cdk synth"))
                .build())

        // Turn this on because the pipeline uses Docker image assets
        .dockerEnabledForSelfMutation(true)
        .build();

pipeline.addWave("MyWave", WaveOptions.builder()
        .post(List.of(
            CodeBuildStep.Builder.create("RunApproval")
                    .commands(List.of("command-from-image"))
                    .buildEnvironment(BuildEnvironment.builder()
                            // The user of a Docker image asset in the pipeline requires turning on
                            // 'dockerEnabledForSelfMutation'.
                            .buildImage(LinuxBuildImage.fromAsset(this, "Image", DockerImageAssetProps.builder()
                                    .directory("./docker-image")
                                    .build()))
                            .build())
                    .build()))
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var pipeline = new CodePipeline(this, "Pipeline", new CodePipelineProps {
    Synth = new ShellStep("Synth", new ShellStepProps {
        Input = CodePipelineSource.Connection("my-org/my-app", "main", new ConnectionSourceOptions {
            ConnectionArn = "arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41"
        }),
        Commands = new [] { "npm ci", "npm run build", "npx cdk synth" }
    }),

    // Turn this on because the pipeline uses Docker image assets
    DockerEnabledForSelfMutation = true
});

pipeline.AddWave("MyWave", new WaveOptions {
    Post = new [] {
        new CodeBuildStep("RunApproval", new CodeBuildStepProps {
            Commands = new [] { "command-from-image" },
            BuildEnvironment = new BuildEnvironment {
                // The user of a Docker image asset in the pipeline requires turning on
                // 'dockerEnabledForSelfMutation'.
                BuildImage = LinuxBuildImage.FromAsset(this, "Image", new DockerImageAssetProps {
                    Directory = "./docker-image"
                })
            }
        }) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
pipeline := pipelines.NewCodePipeline(this, jsii.String("Pipeline"), &CodePipelineProps{
	Synth: pipelines.NewShellStep(jsii.String("Synth"), &ShellStepProps{
		Input: pipelines.CodePipelineSource_Connection(jsii.String("my-org/my-app"), jsii.String("main"), &ConnectionSourceOptions{
			ConnectionArn: jsii.String("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41"),
		}),
		Commands: []*string{
			jsii.String("npm ci"),
			jsii.String("npm run build"),
			jsii.String("npx cdk synth"),
		},
	}),

	// Turn this on because the pipeline uses Docker image assets
	DockerEnabledForSelfMutation: jsii.Boolean(true),
})

pipeline.AddWave(jsii.String("MyWave"), &WaveOptions{
	Post: []Step{
		pipelines.NewCodeBuildStep(jsii.String("RunApproval"), &CodeBuildStepProps{
			Commands: []*string{
				jsii.String("command-from-image"),
			},
			BuildEnvironment: &BuildEnvironment{
				// The user of a Docker image asset in the pipeline requires turning on
				// 'dockerEnabledForSelfMutation'.
				BuildImage: codebuild.LinuxBuildImage_FromAsset(this, jsii.String("Image"), &DockerImageAssetProps{
					Directory: jsii.String("./docker-image"),
				}),
			},
		}),
	},
})

Properties ​

postoptionalStep[]postoptionaltyping.List[Step]postoptionalList<Step>PostoptionalStep[]Postoptional*[]Step #
Additional steps to run after all of the stages in the wave.

Default: No additional steps

preoptionalStep[]preoptionaltyping.List[Step]preoptionalList<Step>PreoptionalStep[]Preoptional*[]Step #
Additional steps to run before any of the stages in the wave.

Default: No additional steps