Skip to content

Commit

Permalink
fix(cli): CLI ignores profile in cdk.json (#7398)
Browse files Browse the repository at this point in the history
The profile option was not being passed from cdk.json.

Get the values from the merged configuration, instead of using the profile argument directly.

Closes #3007
  • Loading branch information
itoyama authored Apr 29, 2020
1 parent bd9b206 commit 6784dc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/aws-cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ async function initCommandLine() {
debug('CDK toolkit version:', version.DISPLAY_VERSION);
debug('Command line arguments:', argv);

const configuration = new Configuration(argv);
await configuration.load();

const sdkProvider = await SdkProvider.withAwsCliCompatibleDefaults({
profile: argv.profile,
profile: configuration.settings.get(['profile']),
ec2creds: argv.ec2creds,
httpOptions: {
proxyAddress: argv.proxy,
caBundlePath: argv['ca-bundle-path'],
},
});

const configuration = new Configuration(argv);
await configuration.load();

const cloudFormation = new CloudFormationDeployments({ sdkProvider });

const cloudExecutable = new CloudExecutable({
Expand Down
1 change: 1 addition & 0 deletions packages/aws-cdk/lib/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export class Settings {
language: argv.language,
pathMetadata: argv.pathMetadata,
assetMetadata: argv.assetMetadata,
profile: argv.profile,
plugin: argv.plugin,
requireApproval: argv.requireApproval,
toolkitStackName: argv.toolkitStackName,
Expand Down

0 comments on commit 6784dc3

Please sign in to comment.