Skip to content

Commit

Permalink
feat(toolkit): notificationArns option in cdk import
Browse files Browse the repository at this point in the history
closes aws#23548
  • Loading branch information
Coderzzzzzzzzzz committed May 12, 2023
1 parent 1c52f89 commit 052b158
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/aws-cdk/lib/cdk-toolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,14 @@ export class CdkToolkit {
throw new Error('--resource-mapping is required when input is not a terminal');
}

if (options.notificationArns) {
options.notificationArns.map( arn => {
if (!validateSnsTopicArn(arn)) {
throw new Error(`Notification arn ${arn} is not a valid arn for an SNS topic`);
}
});
}

const stack = stacks.stackArtifacts[0];

highlight(stack.displayName);
Expand Down Expand Up @@ -493,6 +501,7 @@ export class CdkToolkit {
usePreviousParameters: true,
progress: options.progress,
rollback: options.rollback,
notificationArns: options.notificationArns,
});

// Notify user of next steps
Expand Down Expand Up @@ -1093,6 +1102,11 @@ export interface ImportOptions extends CfnDeployOptions {
* @default false
*/
readonly force?: boolean;

/**
* ARNs of SNS topics that CloudFormation will notify with stack related events
*/
notificationArns?: string[];
}

export interface DestroyOptions {
Expand Down

0 comments on commit 052b158

Please sign in to comment.