# StageProps

Construction properties of a Pipeline Stage.

- Source: [`aws-codepipeline/lib/pipeline.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts#L131)
- Type last changed: v2.186.0 · 27 Mar 2025

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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
};
```

Golang:

```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

- `actions`: [IAction](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.IAction.html)[] — The list of Actions to create this Stage with.

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

- `beforeEntry`: [Conditions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.Conditions.html) — The method to use when a stage allows entry.

  **Default:** No conditions are applied before stage entry

- `onFailure`: [FailureConditions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.FailureConditions.html) — The method to use when a stage has not completed successfully.

  **Default:** No failure conditions are applied

- `onSuccess`: [Conditions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.Conditions.html) — The method to use when a stage has succeeded.

  **Default:** No success conditions are applied

- `stageName`: string (required) — The physical, human-readable name to assign to this Pipeline Stage.

- `transitionDisabledReason`: string — The reason for disabling transition to this stage.

  **Default:** 'Transition disabled'

  Only applicable
  if `transitionToEnabled` is set to `false`.

- `transitionToEnabled`: boolean = true — Whether to enable transition to this stage.
