Skip to content
v2.278.0

StagePlacement Struct ​

Allows you to control where to place a new Stage when it's added to the Pipeline.

Note that you can provide only one of the below properties - specifying more than one will result in a validation error.

Example ​

ts
// Insert a new Stage at an arbitrary point
declare const pipeline: codepipeline.Pipeline;
declare const anotherStage: codepipeline.IStage;
declare const yetAnotherStage: codepipeline.IStage;

const someStage = pipeline.addStage({
  stageName: 'SomeStage',
  placement: {
    // note: you can only specify one of the below properties
    rightBefore: anotherStage,
    justAfter: yetAnotherStage,
  }
});
python
# Insert a new Stage at an arbitrary point
# pipeline: codepipeline.Pipeline
# another_stage: codepipeline.IStage
# yet_another_stage: codepipeline.IStage


some_stage = pipeline.add_stage(
    stage_name="SomeStage",
    placement=codepipeline.StagePlacement(
        # note: you can only specify one of the below properties
        right_before=another_stage,
        just_after=yet_another_stage
    )
)
java
// Insert a new Stage at an arbitrary point
Pipeline pipeline;
IStage anotherStage;
IStage yetAnotherStage;


IStage someStage = pipeline.addStage(StageOptions.builder()
        .stageName("SomeStage")
        .placement(StagePlacement.builder()
                // note: you can only specify one of the below properties
                .rightBefore(anotherStage)
                .justAfter(yetAnotherStage)
                .build())
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
// Insert a new Stage at an arbitrary point
Pipeline pipeline;
IStage anotherStage;
IStage yetAnotherStage;


var someStage = pipeline.AddStage(new StageOptions {
    StageName = "SomeStage",
    Placement = new StagePlacement {
        // note: you can only specify one of the below properties
        RightBefore = anotherStage,
        JustAfter = yetAnotherStage
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Insert a new Stage at an arbitrary point
var pipeline Pipeline
var anotherStage IStage
var yetAnotherStage IStage


someStage := pipeline.AddStage(&StageOptions{
	StageName: jsii.String("SomeStage"),
	Placement: &StagePlacement{
		// note: you can only specify one of the below properties
		RightBefore: anotherStage,
		JustAfter: yetAnotherStage,
	},
})

Properties ​

justAfteroptionalIStagejust_afteroptionalIStagejustAfteroptionalIStageJustAfteroptionalIStageJustAfteroptionalIStage #
Inserts the new Stage as a child of the given Stage (changing its current child Stage, if it had one).
rightBeforeoptionalIStageright_beforeoptionalIStagerightBeforeoptionalIStageRightBeforeoptionalIStageRightBeforeoptionalIStage #
Inserts the new Stage as a parent of the given Stage (changing its current parent Stage, if it had one).