serverless/serverless

Deploy failed when using an mfa device

Open

#11.488 aperta il 31 ott 2022

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (5734 fork)batch import
help wanted

Metriche repository

Star
 (46.915 star)
Metriche merge PR
 (Merge medio 1g 15h) (34 PR mergiate in 30 g)

Descrizione

Are you certain it's a bug?

  • Yes, it looks like a bug

Is the issue caused by a plugin?

  • It is not a plugin issue

Are you using the latest v3 release?

  • Yes, I'm using the latest v3 release

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

I have an issue when my aws profile uses an MFA device. Each time I try to enter a digit of the mfa code, it appears twice on the screen!! and as a result I have an error that tells me that the MFA code is invalid! For example if i enter the mfa code 123456, I can see 112233445566 on the screen (as you can see in the command output sample.

My profile configuration (in .aws/config

[profile xxx]
role_arn=arn:aws:iam::XXXX:role/roleName
source_profile=default
mfa_serial=arn:aws:iam::XXX:mfa/iamUser

Service configuration (serverless.yml) content

service: xxx
useDotenv: true

provider:
  name: aws
  runtime: nodejs14.x
  profile: ${env:AWS_PROFILE, self:custom.defaultProfile}
  stage: ${opt:stage, self:custom.defaultStage}
 ...

Command name and used flags

npx sls deploy

Command output

> npx sls deploy

Deploying XXX to stage v1 (eu-west-1)
112233445566de for arn:aws:iam::XXX:mfa/iamUser: 


✖ Stack XXX failed to deploy (12s)
Environment: darwin, node 14.17.0, framework 3.21.0 (local), plugin 6.2.2, SDK 4.3.2
Credentials: Local, "xxx" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
MultiFactorAuthentication failed with invalid MFA one time pass code.

Environment information

Framework Core: 3.21.0 (local)
Plugin: 6.2.2
SDK: 4.3.2

Guida contributor