Skip to content

Commit

Permalink
chore(toolkit): fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizencc committed Jan 14, 2025
1 parent 1a00609 commit 705bd0b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
8 changes: 8 additions & 0 deletions packages/@aws-cdk/toolkit/lib/actions/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Deployments } from 'aws-cdk/lib/api/deployments';
import { WorkGraph } from 'aws-cdk/lib/util/work-graph';
import { StackSelector } from '../types';
import { StackActivityProgress } from 'aws-cdk/lib/api/util/cloudformation/stack-activity-monitor';

export type DeploymentMethod = DirectDeploymentMethod | ChangeSetDeploymentMethod;

Expand Down Expand Up @@ -234,6 +235,13 @@ export interface DeployOptions extends BaseDeployOptions {
* @deprecated Implement in IoHost instead
*/
readonly ci?: boolean;

/**
* Display mode for stack deployment progress.
*
* @deprecated Implement in IoHost instead
*/
readonly progress?: StackActivityProgress;
}

export function buildParameterMap(parameters?: Map<string, string | undefined>): { [name: string]: { [name: string]: string | undefined } } {
Expand Down
30 changes: 16 additions & 14 deletions packages/@aws-cdk/toolkit/lib/toolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,17 @@ export class Toolkit {
return;
}

if (requireApproval !== RequireApproval.Never) {
const currentTemplate = await this.props.deployments.readCurrentTemplate(stack);
if (printSecurityDiff(currentTemplate, stack, requireApproval)) {
await askUserConfirmation(
concurrency,
'"--require-approval" is enabled and stack includes security-sensitive updates',
'Do you wish to deploy these changes',
);
}
}
// @TODO
// if (requireApproval !== RequireApproval.NEVER) {
// const currentTemplate = await deployments.readCurrentTemplate(stack);
// if (printSecurityDiff(currentTemplate, stack, requireApproval)) {
// await askUserConfirmation(
// concurrency,
// '"--require-approval" is enabled and stack includes security-sensitive updates',
// 'Do you wish to deploy these changes',
// );
// }
// }

// Following are the same semantics we apply with respect to Notification ARNs (dictated by the SDK)
//
Expand Down Expand Up @@ -384,7 +385,7 @@ export class Toolkit {
);
} finally {
if (options.cloudWatchLogMonitor) {
const foundLogGroupsResult = await findCloudWatchLogGroups(this.props.sdkProvider, stack);
const foundLogGroupsResult = await findCloudWatchLogGroups(await this.sdkProvider('deploy'), stack);
options.cloudWatchLogMonitor.addLogGroups(
foundLogGroupsResult.env,
foundLogGroupsResult.sdk,
Expand Down Expand Up @@ -457,6 +458,7 @@ export class Toolkit {
const ioHost = withAction(this.ioHost, 'rollback');
throw new Error('Not implemented yet');
}

/**
* Destroy Action
*
Expand Down Expand Up @@ -484,7 +486,7 @@ export class Toolkit {
}

for (const [index, stack] of stacks.stackArtifacts.entries()) {
await ioHost.notify(success('%s: destroying... [%s/%s]', chalk.blue(stack.displayName), index + 1, stacks.stackCount));
await ioHost.notify(success(`${chalk.blue(stack.displayName)}: destroying... [${index + 1}/${stacks.stackCount}]`));
try {
const deployments = await this.deploymentsForAction(action);
await deployments.destroyStack({
Expand All @@ -493,9 +495,9 @@ export class Toolkit {
roleArn: options.roleArn,
ci: options.ci,
});
await ioHost.notify(success(`\n ✅ %s: ${action}ed`, chalk.blue(stack.displayName)));
await ioHost.notify(success(`\n ✅ ${chalk.blue(stack.displayName)}: ${action}ed`));
} catch (e) {
await ioHost.notify(error(`\n ❌ %s: ${action} failed`, chalk.blue(stack.displayName), e));
await ioHost.notify(error(`\n ❌ ${chalk.blue(stack.displayName)}: ${action} failed ${e}`));
throw e;
}
}
Expand Down

0 comments on commit 705bd0b

Please sign in to comment.