Skip to content
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

chore(toolkit): fix build errors #32924

Merged
merged 1 commit into from
Jan 14, 2025
Merged
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
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
Loading