Skip to content

feat(cdk-pipeline): add url and sns topic for manual approval in cdk pipeline #34227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion packages/aws-cdk-lib/pipelines/lib/blueprint/manual-approval.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Step } from './step';

import { ITopic } from '../../../aws-sns';
/**
* Construction properties for a `ManualApprovalStep`
*/
Expand All @@ -10,6 +10,20 @@ export interface ManualApprovalStepProps {
* @default - No comment
*/
readonly comment?: string;

/**
* The URL for review associated with this manual approval
*
* @default - No URL
*/
readonly reviewUrl?: string;

/**
* Optional SNS topic to send notifications to when an approval is pending
*
* @default - No notifications
*/
readonly notificationTopic?: ITopic;
}

/**
Expand All @@ -29,10 +43,26 @@ export class ManualApprovalStep extends Step {
*/
public readonly comment?: string;

/**
* The URL for review associated with this manual approval
*
* @default - No URL
*/
public readonly reviewUrl?: string;

/**
* Optional SNS topic to send notifications
*
* @default - No notifications
*/
public readonly notificationTopic?: ITopic;

constructor(id: string, props: ManualApprovalStepProps = {}) {
super(id);

this.comment = props.comment;
this.reviewUrl = props.reviewUrl;
this.notificationTopic = props.notificationTopic;

this.discoverReferencedOutputs(props.comment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,8 @@ export class CodePipeline extends PipelineBase {
actionName: options.actionName,
runOrder: options.runOrder,
additionalInformation: step.comment,
externalEntityLink: step.reviewUrl,
notificationTopic: step.notificationTopic,
}));
return { runOrdersConsumed: 1 };
},
Expand Down
Loading