lumigo-io / lumigo-CLI

Open source CLI tool to help you develop and manage serverless applications.
https://lumigo.io
Apache License 2.0
331 stars 21 forks source link

Missing credentials in config error when using lumigo-cli with --profile + MFA #97

Open TLaue opened 4 years ago

TLaue commented 4 years ago

I am have tried to use lumigo-cli with the --profile option resulting the the following error message:

CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1 at SharedIniFileCredentials.load (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/credentials/shared_ini_file_credentials.js:101:11) at SharedIniFileCredentials.coalesceRefresh (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/credentials.js:205:12) at SharedIniFileCredentials.refresh (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/credentials/shared_ini_file_credentials.js:168:10) at SharedIniFileCredentials.get (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/credentials.js:122:12) at getAsyncCredentials (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/config.js:398:24) at Config.getCredentials (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/config.js:418:9) at Request.VALIDATE_CREDENTIALS (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/event_listeners.js:81:26) at Request.callListeners (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/sequential_executor.js:102:18) at Request.emit (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10) at Request.emit (~/.nvm/versions/node/v12.16.1/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/request.js:683:14)

I have tried to access an AWS account using an IAM role which requires an MFA token to be specified respectively the IAM user (living in a different AWS account) tries to assume a role in the target account which requires MFA support.

The profile in the AWS config file looks like this:

[profile xxx]
source_profile = yyy
role_arn = arn:aws:iam::xxx:role/...
mfa_serial = arn:aws:iam::xxx:mfa/...
region = eu-central-1

Is there any way to get this setup working with lumigo-cli?