-
Notifications
You must be signed in to change notification settings - Fork 17
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
Error: Need to perform AWS calls for account 000, but no credentials have been configured #39
Comments
Thanks for reporting @rcbyron . Can you please try including |
I am still receiving the same error after enabling STS and all services |
Thanks for the update @rcbyron . Any updates for this - can you please try again after removing any relevant metadata in |
@whummer I tried deleting cdk.out with no luck. The 000 account ID comes from my environment file when creating my root stack. I've tried with my actual account ID but the result is the same. const app = new cdk.App();
new MyRootCdkStack(app, 'MyRootCdkStack', process.env.boundaryPolicyArn, {
env: { region: process.env.region, account: process.env.account }, // <-- 000 account ID gets set here from environment file
}); export class MyRootCdkStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, boundaryPolicyArn: string | undefined, props?: cdk.StackProps) {
super(scope, id, props);
Aspects.of(scope).add(new PermissionsBoundary(boundaryPolicyArn));
const lambdaStack = new LambdaStack(this, 'MyLambdaStack', { env: props?.env }); // <-- fails here
const apiGatwayStack = new ApiGatewayStack(this, 'MyApiGatewayStack', lambdaStack.lambdaFunctions, { env: props?.env });
}
} This stack creates the PermissionsBoundary (custom class) successfully, and then tries to create a lambda/API gateway stack. It shows the |
Output from
Output from
|
This issue is also coming from Setting "CDK_DEFAULT_REGION" environment variable to us-east-1 Resolving default credentials Unable to determine the default AWS account: TypeError: Cannot redefine property: saml at Function.defineProperty () at /usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/shared-ini/ini-loader.js:11:14 at Array.forEach () at IniLoader.parseFile (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/shared-ini/ini-loader.js:8:26) at IniLoader.loadFrom (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/shared-ini/ini-loader.js:56:30) at Object.getProfilesFromSharedConfig (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/util.js:969:42) at ProcessCredentials.load (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/credentials/process_credentials.js:75:31) at ProcessCredentials.coalesceRefresh (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/credentials.js:205:12) at ProcessCredentials.refresh (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/credentials/process_credentials.js:163:10) at ProcessCredentials.get (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/credentials.js:122:12) How to check if it's due to profile name conflicts
When can it happen when you have same entry in
Or
Notice There's this code in /usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/shared-ini/ini-loader.js
It tries to define the saml property again and that's where it fails How to resolve?Remove the entry with |
Same issue here. Even bootstrapping does not work.
My stacks are configured to deploy to specific environments with hard-coded account IDs. |
Thanks for the updated @moltar @ajaysuwalka . Can you please share the detailed log output with verbose logging enabled:
(Please make sure that no sensitive details from the logs get shared here.) Thanks! |
@whummer Sorry but that's really outdated stuff now, but the method that I had specified, works fine. |
Getting the error
|
We get the same error (
|
For anyone else landing here, found a summary of similar issues and pasted answer here See also: |
Feel free to reopen if any new issues regarding this come up. For now it seems like this issue has been handled in multiple locations already and doesn't directly involve the wrapper script here. |
@edible-programs Your issue might be related to a breaking change in Nodejs v17 as As a workaround, you can set |
@edible-programs We just (2023-02-15T12:22:38.576Z) released a new version of aws-cdk-local 2.17.0, which implements an IPv4 fallback to fix IPv6-related issues on macOS. |
Hi Having this issue when I try to bootstrap localstack on AWS Codebuild. This is the error: |
I have the same problem in CircleCI I am just trying to run it works locally, without even the localstack container running, but same thing in CircleCI gives "Need to perform AWS calls for account 000000000000, but no credentials have been configured" I have the accountid hardcoded to |
Error running cdklocal bootstrap & deploy
Environment aws://000/us-west-2 failed bootstrapping: Error: Need to perform AWS calls for account 000, but no credentials have been configured
I am running localstack start in one powershell and cdklocal bootstrap/deploy in another. I also tried once with localstack started in a docker container and mapped to my computer's "localhost:4566"
Everything works fine when I actually deploy to AWS/CDK but does not work when I try localstack/CDK.
Troubleshooting
I feel like I've tried just about everything to get this to work, but no luck yet (including solutions from the other issues like #36 (comment) & #38). Here's what I've tried:
Deleting node_modules and cdk.out, then combinations of installing aws-cdk-local 1.65.3 & aws-cdk 1.86.0/1.89.0, globally/locally
Executing locally installed packages via "npx" command (e.g.
npx cdklocal bootstrap
)Using
cdklocal --profile
flag with my actual account name and also with "default"Setup
I can start my localstack just fine on Windows 10 and also in docker:
http://localhost:4566/health
C:/Users/me/.aws/config
C:/Users/me/.aws/credentials
package.json
The text was updated successfully, but these errors were encountered: