question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[core] v1.60.0 no longer accepts --profile flag

See original GitHub issue

I manage multiple AWS accounts and for each, I have a profile configured. In versions <1.60.0 of cdk, I could specify a profile using the --profile <profile-name>. For example if I wanted to use the diff command with the work profile, I would type:

yarn cdk --profile work diff

I am no longer able to do this on version 1.60.0.

Reproduction Steps

  • Create a stack using v1.59.0 and deploy it
  • Update your version to v1.60.0 and attempt to run diff or deploy command on the same stack

What did you expect to happen?

Upgrading to v1.60.0 would not affect passing credentials.

What actually happened?

I now receive the error:

Need to perform AWS calls for account <number>, but no credentials have been configured.

Environment

  • CLI Version: 1.60.0
  • Framework Version: 1.60.0
  • Node.js Version: v10.22.0
  • OS : mac-os
  • Language (Version): TypeScript

Other

As a result of this, my team is stuck on v1.59.0


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
mrpacketheadcommented, Aug 25, 2020

Hi…

It appears that there is a requirement for CDK to need to have a default profile even though i am not using it.

I added this

[profile default] region = ap-southeast-2 output = json

And it seems to work. SOmething has changed in 1.60 that has changed this.

3reactions
fennbcommented, Aug 26, 2020

Some further research in diffing the -vvv output between patched (working) and unpatched (broken) versions yields the following:

$ diff output.working output.broken
105,108c105,118
< Looking up default account ID from STS
< [AWS sts 200 0.259s 0 retries] getCallerIdentity({})
< Default account ID: 887534651732
< Setting "CDK_DEFAULT_ACCOUNT" environment variable to [REDACTED]
---
> Unable to determine the default AWS account: { ConfigError: Missing region in config
>     at Request.optInRegionalEndpoint (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/services/sts.js:75:30)
>     at Request.callListeners (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
>     at Request.emit (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
>     at Request.emit (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:688:14)
>     at Request.transition (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:22:10)
>     at AcceptorStateMachine.runTo (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:14:12)
>     at Request.runTo (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:408:15)
>     at Request.send (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:372:10)
>     at features.constructor.makeRequest (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/service.js:205:27)
>     at features.constructor.svc.(anonymous function) [as assumeRole] (/usr/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/service.js:677:23)
>   message: 'Missing region in config',
>   code: 'ConfigError',
>   time: 2020-08-26T02:27:18.616Z }
133d142
<   CDK_DEFAULT_ACCOUNT: '[REDACTED]',
---snip---
186,203c195,198
< [AWS cloudformation 200 1.042s 0 retries] describeStacks({ StackName: 'REDACTED' })
< [AWS cloudformation 200 2.847s 0 retries] getTemplate({ StackName: 'REDACTED',
<   TemplateStage: 'Original' })
< This deployment will make potentially sensitive changes according to your current security approval level (--require-approval broadening).
< Please confirm you intend to make the following modifications:
<
---snip---
> Need to perform AWS calls for account [REDACTED], but no credentials have been configured.
> Error: Need to perform AWS calls for account [REDACTED], but no credentials have been configured.
>     at SdkProvider.obtainCredentials (/usr/lib/node_modules/aws-cdk/lib/api/aws-auth/sdk-provider.ts:237:11)
>     at process._tickCallback (internal/process/next_tick.js:68:7)

As a temporary workaround - if you define a region in your profile, it seems to work (and doesn’t seem to matter what region it is), eg ~/.aws/config:

[profile development]
role_arn = arn:aws:iam::XXXX:role/OrganizationAccountAccessRole
source_profile = default
region = us-east-1 ; Required workaround for https://github.com/aws/aws-cdk/issues/9937
Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions (FAQ) - FLAG System
How do I use profiles to pre-fill information within my applications? I am an Agricultural Association filing as a joint employer with multiple...
Read more >
How to fix java.lang.UnsupportedClassVersionError
This may occur when compiler source is set in non-compliance with currently compiling JRE/JDK. For example i found the below values from eclipse...
Read more >
1558025 - Copying a profile between machines leaves behind ...
Hi, get this error on FF 67.0.1, not using a master password. 1560076336270 Sync.LogManager DEBUG Flushing file log 1560076336271 FirefoxAccounts TRACE not ......
Read more >
JobTemplates - AWS Elemental MediaConvert API Reference
This will return the templates themselves, not just a list of them. ... The service no longer accepts the value DISABLED for AntiAlias....
Read more >
Changelog - Rclone
Windows: fix slow opening of exe files by not truncating files when not ... Remove link to rclone slack as it is no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found