Skip to content
v2.278.0

ManualApprovalStep Class ​

A manual approval step.

If this step is added to a Pipeline, the Pipeline will be paused waiting for a human to resume it

Only engines that support pausing the deployment will support this step type.

Example ​

ts
declare const pipeline: pipelines.CodePipeline;
const preprod = new MyApplicationStage(this, 'PreProd');
const prod = new MyApplicationStage(this, 'Prod');
const topic = new sns.Topic(this, 'ChangeApprovalTopic');

pipeline.addStage(preprod, {
  post: [
    new pipelines.ShellStep('Validate Endpoint', {
      commands: ['curl -Ssf https://my.webservice.com/'],
    }),
  ],
});
pipeline.addStage(prod, {
  pre: [new pipelines.ManualApprovalStep('PromoteToProd', {
    //All options below are optional
    comment: 'Please validate changes',
    reviewUrl: 'https://my.webservice.com/',
    notificationTopic: topic,
  })],
});
python
# pipeline: pipelines.CodePipeline

preprod = MyApplicationStage(self, "PreProd")
prod = MyApplicationStage(self, "Prod")
topic = sns.Topic(self, "ChangeApprovalTopic")

pipeline.add_stage(preprod,
    post=[
        pipelines.ShellStep("Validate Endpoint",
            commands=["curl -Ssf https://my.webservice.com/"]
        )
    ]
)
pipeline.add_stage(prod,
    pre=[pipelines.ManualApprovalStep("PromoteToProd",
        # All options below are optional
        comment="Please validate changes",
        review_url="https://my.webservice.com/",
        notification_topic=topic
    )]
)
java
CodePipeline pipeline;

MyApplicationStage preprod = new MyApplicationStage(this, "PreProd");
MyApplicationStage prod = new MyApplicationStage(this, "Prod");
Topic topic = new Topic(this, "ChangeApprovalTopic");

pipeline.addStage(preprod, AddStageOpts.builder()
        .post(List.of(
            ShellStep.Builder.create("Validate Endpoint")
                    .commands(List.of("curl -Ssf https://my.webservice.com/"))
                    .build()))
        .build());
pipeline.addStage(prod, AddStageOpts.builder()
        .pre(List.of(ManualApprovalStep.Builder.create("PromoteToProd")
                //All options below are optional
                .comment("Please validate changes")
                .reviewUrl("https://my.webservice.com/")
                .notificationTopic(topic)
                .build()))
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
CodePipeline pipeline;

var preprod = new MyApplicationStage(this, "PreProd");
var prod = new MyApplicationStage(this, "Prod");
var topic = new Topic(this, "ChangeApprovalTopic");

pipeline.AddStage(preprod, new AddStageOpts {
    Post = new [] {
        new ShellStep("Validate Endpoint", new ShellStepProps {
            Commands = new [] { "curl -Ssf https://my.webservice.com/" }
        }) }
});
pipeline.AddStage(prod, new AddStageOpts {
    Pre = new [] { new ManualApprovalStep("PromoteToProd", new ManualApprovalStepProps {
        //All options below are optional
        Comment = "Please validate changes",
        ReviewUrl = "https://my.webservice.com/",
        NotificationTopic = topic
    }) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var pipeline CodePipeline

preprod := newMyApplicationStage(this, jsii.String("PreProd"))
prod := newMyApplicationStage(this, jsii.String("Prod"))
topic := sns.NewTopic(this, jsii.String("ChangeApprovalTopic"))

pipeline.AddStage(preprod, &AddStageOpts{
	Post: []Step{
		pipelines.NewShellStep(jsii.String("Validate Endpoint"), &ShellStepProps{
			Commands: []*string{
				jsii.String("curl -Ssf https://my.webservice.com/"),
			},
		}),
	},
})
pipeline.AddStage(prod, &AddStageOpts{
	Pre: []Step{
		pipelines.NewManualApprovalStep(jsii.String("PromoteToProd"), &ManualApprovalStepProps{
			//All options below are optional
			Comment: jsii.String("Please validate changes"),
			ReviewUrl: jsii.String("https://my.webservice.com/"),
			NotificationTopic: topic,
		}),
	},
})

Initializer ​

ts
new ManualApprovalStep(id: string, props?: ManualApprovalStepProps)
python
ManualApprovalStep(id: str, props: typing.Optional[ManualApprovalStepProps] = None)
java
new ManualApprovalStep(String id, ManualApprovalStepProps props)
csharp
new ManualApprovalStep(string id, ManualApprovalStepProps? props = null)
go
NewManualApprovalStep(Id *string, Props ManualApprovalStepProps)

Properties ​

commentmay be undefinedstringcommentmay be undefinedstrcommentmay be undefinedStringCommentmay be undefinedstringCommentmay be undefined*string #
The comment associated with this manual approval.

Default: No comment

consumedStackOutputsStackOutputReference[]consumed_stack_outputstyping.List[StackOutputReference]consumedStackOutputsList<StackOutputReference>ConsumedStackOutputsStackOutputReference[]ConsumedStackOutputs*[]StackOutputReference #
StackOutputReferences this step consumes.
dependenciesStep[]dependenciestyping.List[Step]dependenciesList<Step>DependenciesStep[]Dependencies*[]Step #
Return the steps this step depends on, based on the FileSets it requires.
dependencyFileSetsFileSet[]dependency_file_setstyping.List[FileSet]dependencyFileSetsList<FileSet>DependencyFileSetsFileSet[]DependencyFileSets*[]FileSet #
The list of FileSets consumed by this Step.
idstringidstridStringIdstringId*string #
Identifier for this step.
isSourcebooleanis_sourceboolisSourceBooleanIsSourceboolIsSource*bool #
Whether or not this is a Source step.

What it means to be a Source step depends on the engine.

notificationTopicmay be undefinedITopicnotification_topicmay be undefinedITopicnotificationTopicmay be undefinedITopicNotificationTopicmay be undefinedITopicNotificationTopicmay be undefinedITopic #
Optional SNS topic to send notifications.

Default: No notifications

primaryOutputmay be undefinedFileSetprimary_outputmay be undefinedFileSetprimaryOutputmay be undefinedFileSetPrimaryOutputmay be undefinedFileSetPrimaryOutputmay be undefinedFileSet #
The primary FileSet produced by this Step.

Not all steps produce an output FileSet--if they do you can substitute the Step object for the FileSet object.

reviewUrlmay be undefinedstringreview_urlmay be undefinedstrreviewUrlmay be undefinedStringReviewUrlmay be undefinedstringReviewUrlmay be undefined*string #
The URL for review associated with this manual approval.

Default: No URL

Methods ​

addStepDependency(step: Step): voiddef add_step_dependency(self, step: Step) -> Nonepublic void addStepDependency(Step step)public void AddStepDependency(Step step)func AddStepDependency(Step Step) #
Add a dependency on another step.
sequence(steps: Step[]): Step[]@staticmethod def sequence(steps: typing.List[Step]) -> typing.List[Step]public static List<Step> sequence(List<Step> steps)public static Step[] Sequence(Step[] steps)func Sequence(Steps *[]Step) *[]Step static #
Define a sequence of steps to be executed in order.

If you need more fine-grained step ordering, use the addStepDependency() API. For example, if you want secondStep to occur after firstStep, call secondStep.addStepDependency(firstStep).

toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string #
Return a string representation of this Step.