-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cdk command returns InvalidClientTokenId: The security token included in the request is invalid. #8535
Comments
The "cdk synth" command or any cdk command for that matter keeps returning: InvalidClientTokenId: The security token included in the request is invalid. I am running in a macOS term window. The CDK is just building a YAML template from the sample code, so I am not sure why it needs to authenticate anything at this point, its all local. I have an AWS account with a default profile setup in my ~/.aws/config and ~/.aws/credentials files. I have even tried setting my access_key and security_id env variables and still get this error. This seems to be a bug. Can someone assist? |
@ironlyon1906 can you expand a little more on what the steps to reproduce the scenario you're running into? i.e. what does the structure of your ~/.aws/config and ~/.aws/credentials files look like. Did you try using profiles? How did you try to set the env variables? |
To my understanding, the CDK uses the AWS CLI under the covers. I am trying to run the sample app CDK app using java, all locally on my MacOS. Here is my AWS CLI version: bash-3.2$ aws --version When I run either of the below commands, they return: To answer your question: in my ~/.aws directory I have a config file and a credentials file |
@ironlyon1906 can you run the cdk command with my
my
|
Hi Shivlaks, I have solved the problem. I uninstalled AWS CLI ver 1.x and installed AWS CLI ver 2.x . |
@ironlyon1906 glad to hear you're all set. I'm resolving this issue for now. Feel free to reopen if you have any unresolved questions or follow-up that you'd like to see from us! |
I had same error |
I was facing a similar issue. When I checked ~/.aws/credentials file I saw an additional statement referring to token "{someprefix}-token" with no value. I don't know what generated this entry. When I removed it (without touching aws_access_key_id, aws_secret_access_key), my cdk started working :). I am using cdk version - 2.39.1 (build f188fac) |
Hello, I am currently facing the same issue. I'm trying to run cdk deploy in a GitLab Runner docker instance, with a SSO profile configured. I ran the command
However when the command is run in the pipeline it returns this:
Eventually ending in a |
❓ General Issue
The Question
Environment
Other information
The text was updated successfully, but these errors were encountered: