Skip to content

Commit cf6d634

Browse files
authored
chore: Minor updates for the used deployment methods (#24649)
> [CONTRIBUTING GUIDE]: https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md > [DESIGN GUIDELINES]: https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md This work is tangential to code I am editing, splitting the function from non-functional changes. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent e8158af commit cf6d634

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

packages/aws-cdk/lib/cdk-toolkit.ts

+9-13
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export enum AssetBuildTime {
8686
* Build assets just-in-time, before publishing
8787
*/
8888
JUST_IN_TIME,
89-
};
89+
}
9090

9191
/**
9292
* Toolkit logic
@@ -489,11 +489,7 @@ export class CdkToolkit {
489489
roleArn: options.roleArn,
490490
toolkitStackName: options.toolkitStackName,
491491
tags,
492-
deploymentMethod: {
493-
method: 'change-set',
494-
changeSetName: options.changeSetName,
495-
execute: options.execute,
496-
},
492+
deploymentMethod: options.deploymentMethod,
497493
usePreviousParameters: true,
498494
progress: options.progress,
499495
rollback: options.rollback,
@@ -612,16 +608,16 @@ export class CdkToolkit {
612608
/**
613609
* Bootstrap the CDK Toolkit stack in the accounts used by the specified stack(s).
614610
*
615-
* @param environmentSpecs environment names that need to have toolkit support
616-
* provisioned, as a glob filter. If none is provided,
617-
* all stacks are implicitly selected.
618-
* @param toolkitStackName the name to be used for the CDK Toolkit stack.
611+
* @param userEnvironmentSpecs environment names that need to have toolkit support
612+
* provisioned, as a glob filter. If none is provided, all stacks are implicitly selected.
613+
* @param bootstrapper Legacy or modern.
614+
* @param options The name, role ARN, bootstrapping parameters, etc. to be used for the CDK Toolkit stack.
619615
*/
620616
public async bootstrap(userEnvironmentSpecs: string[], bootstrapper: Bootstrapper, options: BootstrapEnvironmentOptions): Promise<void> {
621617
// If there is an '--app' argument and an environment looks like a glob, we
622-
// select the environments from the app. Otherwise use what the user said.
618+
// select the environments from the app. Otherwise, use what the user said.
623619

624-
// By default glob for everything
620+
// By default, glob for everything
625621
const environmentSpecs = userEnvironmentSpecs.length > 0 ? [...userEnvironmentSpecs] : ['**'];
626622

627623
// Partition into globs and non-globs (this will mutate environmentSpecs).
@@ -1085,7 +1081,7 @@ export interface ImportOptions extends CfnDeployOptions {
10851081
readonly recordResourceMapping?: string;
10861082

10871083
/**
1088-
* Path to a file with with the physical resource mapping to CDK constructs in JSON format
1084+
* Path to a file with the physical resource mapping to CDK constructs in JSON format
10891085
*
10901086
* @default - No mapping file
10911087
*/

packages/aws-cdk/lib/cli.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ export async function exec(args: string[], synthesizer?: Synthesizer): Promise<n
470470
return cli.list(args.STACKS, { long: args.long, json: argv.json });
471471

472472
case 'diff':
473-
const enableDiffNoFail = isFeatureEnabled(configuration, cxapi.ENABLE_DIFF_NO_FAIL);
473+
const enableDiffNoFail = isFeatureEnabled(configuration, cxapi.ENABLE_DIFF_NO_FAIL_CONTEXT);
474474
return cli.diff({
475475
stackNames: args.STACKS,
476476
exclusively: args.exclusively,
@@ -575,8 +575,11 @@ export async function exec(args: string[], synthesizer?: Synthesizer): Promise<n
575575
selector,
576576
toolkitStackName,
577577
roleArn: args.roleArn,
578-
execute: args.execute,
579-
changeSetName: args.changeSetName,
578+
deploymentMethod: {
579+
method: 'change-set',
580+
execute: args.execute,
581+
changeSetName: args.changeSetName,
582+
},
580583
progress: configuration.settings.get(['progress']),
581584
rollback: configuration.settings.get(['rollback']),
582585
recordResourceMapping: args['record-resource-mapping'],
@@ -596,7 +599,10 @@ export async function exec(args: string[], synthesizer?: Synthesizer): Promise<n
596599
toolkitStackName,
597600
roleArn: args.roleArn,
598601
reuseAssets: args['build-exclude'],
599-
changeSetName: args.changeSetName,
602+
deploymentMethod: {
603+
method: 'change-set',
604+
changeSetName: args.changeSetName,
605+
},
600606
force: args.force,
601607
progress: configuration.settings.get(['progress']),
602608
rollback: configuration.settings.get(['rollback']),

packages/aws-cdk/lib/import.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class ResourceImporter {
119119
* Based on the provided resource mapping, prepare CFN structures for import (template,
120120
* ResourcesToImport structure) and perform the import operation (CloudFormation deployment)
121121
*
122-
* @param resourceMap Mapping from CDK construct tree path to physical resource import identifiers
122+
* @param importMap Mapping from CDK construct tree path to physical resource import identifiers
123123
* @param options Options to pass to CloudFormation deploy operation
124124
*/
125125
public async importResources(importMap: ImportMap, options: DeployStackOptions) {

0 commit comments

Comments
 (0)