interface Conditions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodePipeline.Conditions |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscodepipeline#Conditions |
![]() | software.amazon.awscdk.services.codepipeline.Conditions |
![]() | aws_cdk.aws_codepipeline.Conditions |
![]() | aws-cdk-lib » aws_codepipeline » Conditions |
The conditions for making checks for the stage.
Example
declare const sourceAction: codepipeline_actions.CodeStarConnectionsSourceAction;
declare const buildAction: codepipeline_actions.CodeBuildAction;
new codepipeline.Pipeline(this, 'Pipeline', {
pipelineType: codepipeline.PipelineType.V2,
stages: [
{
stageName: 'Source',
actions: [sourceAction],
},
{
stageName: 'Build',
actions: [buildAction],
// BeforeEntry condition - checks before entering the stage
beforeEntry: {
conditions: [{
rules: [ new codepipeline.Rule({
name: 'LambdaCheck',
provider: 'LambdaInvoke',
version: '1',
configuration: {
FunctionName: 'LambdaFunctionName',
},
})],
result: codepipeline.Result.FAIL,
}],
},
// OnSuccess condition - checks after successful stage completion
onSuccess: {
conditions: [{
result: codepipeline.Result.FAIL,
rules: [new codepipeline.Rule({
name: 'CloudWatchCheck',
provider: 'LambdaInvoke',
version: '1',
configuration: {
AlarmName: 'AlarmName1',
WaitTime: '300', // 5 minutes
FunctionName: 'funcName2'
},
})],
}],
},
// OnFailure condition - handles stage failure
onFailure: {
conditions: [{
result: codepipeline.Result.ROLLBACK,
rules: [new codepipeline.Rule({
name: 'RollBackOnFailure',
provider: 'LambdaInvoke',
version: '1',
configuration: {
AlarmName: 'Alarm',
WaitTime: '300', // 5 minutes
FunctionName: 'funcName1'
},
})],
}],
},
},
],
});
Properties
Name | Type | Description |
---|---|---|
conditions? | Condition [] | The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage. |
conditions?
Type:
Condition
[]
(optional, default: No conditions are configured)
The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage.