Skip to content
v2.278.0

StageProps Struct ​

Construction properties of a Pipeline Stage.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codepipeline as codepipeline } from 'aws-cdk-lib';

declare const action: codepipeline.Action;
declare const rule: codepipeline.Rule;
const stageProps: codepipeline.StageProps = {
  stageName: 'stageName',

  // the properties below are optional
  actions: [action],
  beforeEntry: {
    conditions: [{
      result: codepipeline.Result.ROLLBACK,
      rules: [rule],
    }],
  },
  onFailure: {
    conditions: [{
      result: codepipeline.Result.ROLLBACK,
      rules: [rule],
    }],
    result: codepipeline.Result.ROLLBACK,
    retryMode: codepipeline.RetryMode.ALL_ACTIONS,
  },
  onSuccess: {
    conditions: [{
      result: codepipeline.Result.ROLLBACK,
      rules: [rule],
    }],
  },
  transitionDisabledReason: 'transitionDisabledReason',
  transitionToEnabled: false,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codepipeline as codepipeline

# action: codepipeline.Action
# rule: codepipeline.Rule

stage_props = codepipeline.StageProps(
    stage_name="stageName",

    # the properties below are optional
    actions=[action],
    before_entry=codepipeline.Conditions(
        conditions=[codepipeline.Condition(
            result=codepipeline.Result.ROLLBACK,
            rules=[rule]
        )]
    ),
    on_failure=codepipeline.FailureConditions(
        conditions=[codepipeline.Condition(
            result=codepipeline.Result.ROLLBACK,
            rules=[rule]
        )],
        result=codepipeline.Result.ROLLBACK,
        retry_mode=codepipeline.RetryMode.ALL_ACTIONS
    ),
    on_success=codepipeline.Conditions(
        conditions=[codepipeline.Condition(
            result=codepipeline.Result.ROLLBACK,
            rules=[rule]
        )]
    ),
    transition_disabled_reason="transitionDisabledReason",
    transition_to_enabled=False
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codepipeline.*;

Action action;
Rule rule;

StageProps stageProps = StageProps.builder()
        .stageName("stageName")

        // the properties below are optional
        .actions(List.of(action))
        .beforeEntry(Conditions.builder()
                .conditions(List.of(Condition.builder()
                        .result(Result.ROLLBACK)
                        .rules(List.of(rule))
                        .build()))
                .build())
        .onFailure(FailureConditions.builder()
                .conditions(List.of(Condition.builder()
                        .result(Result.ROLLBACK)
                        .rules(List.of(rule))
                        .build()))
                .result(Result.ROLLBACK)
                .retryMode(RetryMode.ALL_ACTIONS)
                .build())
        .onSuccess(Conditions.builder()
                .conditions(List.of(Condition.builder()
                        .result(Result.ROLLBACK)
                        .rules(List.of(rule))
                        .build()))
                .build())
        .transitionDisabledReason("transitionDisabledReason")
        .transitionToEnabled(false)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodePipeline;

Action action;
Rule rule;

var stageProps = new StageProps {
    StageName = "stageName",

    // the properties below are optional
    Actions = new [] { action },
    BeforeEntry = new Conditions {
        Conditions = new [] { new Condition {
            Result = Result.ROLLBACK,
            Rules = new [] { rule }
        } }
    },
    OnFailure = new FailureConditions {
        Conditions = new [] { new Condition {
            Result = Result.ROLLBACK,
            Rules = new [] { rule }
        } },
        Result = Result.ROLLBACK,
        RetryMode = RetryMode.ALL_ACTIONS
    },
    OnSuccess = new Conditions {
        Conditions = new [] { new Condition {
            Result = Result.ROLLBACK,
            Rules = new [] { rule }
        } }
    },
    TransitionDisabledReason = "transitionDisabledReason",
    TransitionToEnabled = false
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var action Action
var rule Rule

stageProps := &StageProps{
	StageName: jsii.String("stageName"),

	// the properties below are optional
	Actions: []IAction{
		action,
	},
	BeforeEntry: &Conditions{
		Conditions: []Condition{
			&Condition{
				Result: awscdk.Aws_codepipeline.Result_ROLLBACK,
				Rules: []Rule{
					rule,
				},
			},
		},
	},
	OnFailure: &FailureConditions{
		Conditions: []Condition{
			&Condition{
				Result: awscdk.*Aws_codepipeline.Result_ROLLBACK,
				Rules: []Rule{
					rule,
				},
			},
		},
		Result: awscdk.*Aws_codepipeline.Result_ROLLBACK,
		RetryMode: awscdk.*Aws_codepipeline.RetryMode_ALL_ACTIONS,
	},
	OnSuccess: &Conditions{
		Conditions: []Condition{
			&Condition{
				Result: awscdk.*Aws_codepipeline.Result_ROLLBACK,
				Rules: []Rule{
					rule,
				},
			},
		},
	},
	TransitionDisabledReason: jsii.String("transitionDisabledReason"),
	TransitionToEnabled: jsii.Boolean(false),
}

Properties ​

actionsoptionalIAction[]actionsoptionaltyping.List[IAction]actionsoptionalList<IAction>ActionsoptionalIAction[]Actionsoptional*[]IAction #
The list of Actions to create this Stage with.

You can always add more Actions later by calling IStage#addAction.

beforeEntryoptionalConditionsbefore_entryoptionalConditionsbeforeEntryoptionalConditionsBeforeEntryoptionalConditionsBeforeEntryoptionalConditions #
The method to use when a stage allows entry.

Default: No conditions are applied before stage entry

onFailureoptionalFailureConditionson_failureoptionalFailureConditionsonFailureoptionalFailureConditionsOnFailureoptionalFailureConditionsOnFailureoptionalFailureConditions #
The method to use when a stage has not completed successfully.

Default: No failure conditions are applied

onSuccessoptionalConditionson_successoptionalConditionsonSuccessoptionalConditionsOnSuccessoptionalConditionsOnSuccessoptionalConditions #
The method to use when a stage has succeeded.

Default: No success conditions are applied

stageNamestringstage_namestrstageNameStringStageNamestringStageName*string required #
The physical, human-readable name to assign to this Pipeline Stage.
transitionDisabledReasonoptionalstringtransition_disabled_reasonoptionalstrtransitionDisabledReasonoptionalStringTransitionDisabledReasonoptionalstringTransitionDisabledReasonoptional*string #
The reason for disabling transition to this stage.

Default: 'Transition disabled'

Only applicable if transitionToEnabled is set to false.

transitionToEnabledoptionalbooleantransition_to_enabledoptionalbooltransitionToEnabledoptionalBooleanTransitionToEnabledoptionalboolTransitionToEnabledoptional*bool = true #
Whether to enable transition to this stage.