CLI: Not prompting for MFA code with AWS_PROFILE envar after CDK v2.167.0 / SDK v3 #32312
Closed
1 task done
Labels
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p0
package/tools
Related to AWS CDK Tools or CLI
potential-regression
Marking this issue as a potential regression to be checked by team member
Describe the bug
When using an IAM profile/role that requires multi-factor authentication in the
AWS_PROFILE
envar, the CDK CLI is not prompting for the MFA code, resulting in a missing credentials error.Regression Issue
Last Known Working CDK Version
2.166
Expected Behavior
The CDK CLI should prompt for a MFA code when a profile that requires MFA is set in the
AWS_PROFILE
envarCurrent Behavior
The CDK CLI is unable to prompt because it does not have a MFA callback handler:
Reproduction Steps
in
~/.aws/.config
, create a profile that requires MFAthen export that profile to the
AWS_PROFILE
envarnow run any cdk command that performs AWS calls:
Possible Solution
No response
Additional Information/Context
passing the
--profile
argument to the CDK CLI does prompt for MFA credentialsThe logs when using
--profile
vs. logs when using
AWS_PROFILE
when using
AWS_PROFILE
the log message does identify the correct profileCDK CLI Version
2.171.0 (build 4957967)
Framework Version
No response
Node.js Version
v20.12.2
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: