org-formation / org-formation-cli

Better than landingzones!
MIT License
1.4k stars 129 forks source link

Profile XXXX_PROFILE requires multi-factor authentication, but no MFA code callback was provided. #554

Open aheissenberger opened 3 months ago

aheissenberger commented 3 months ago

Subject of the issue

after upgrading to the latest version I can no longer deploy the configuration:

$ /aws-org-infrastructure/node_modules/.bin/org-formation perform-tasks organization-task.yml --print-stack --profile XXXX_PROFILE
(node:38907) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
ERROR: unexpected error occurred...
Profile XXXX_PROFILE requires multi-factor authentication, but no MFA code callback was provided.
CredentialsProviderError: Profile XXXX_PROFILE requires multi-factor authentication, but no MFA code callback was provided.
    at resolveAssumeRoleCredentials (/aws-org-infrastructure/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js:104:13)
    at async /aws-org-infrastructure/node_modules/@smithy/property-provider/dist-cjs/index.js:79:27
    at async coalesceProvider (/aws-org-infrastructure/node_modules/@smithy/property-provider/dist-cjs/index.js:106:18)
    at async /aws-org-infrastructure/node_modules/@smithy/property-provider/dist-cjs/index.js:124:18
    at async /aws-org-infrastructure/node_modules/aws-organization-formation/node_modules/@smithy/property-provider/dist-cjs/index.js:79:27
    at async coalesceProvider (/aws-org-infrastructure/node_modules/@smithy/core/dist-cjs/index.js:288:18)
    at async /aws-org-infrastructure/node_modules/@smithy/core/dist-cjs/index.js:306:18
    at async /aws-org-infrastructure/node_modules/@smithy/core/dist-cjs/index.js:82:17
    at async /aws-org-infrastructure/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:34:22
    at async AwsUtil.Initialize (/aws-org-infrastructure/node_modules/aws-organization-formation/dist/src/util/aws-util.js:127:24)
    at async PerformTasksCommand.initialize (/aws-org-infrastructure/node_modules/aws-organization-formation/dist/src/commands/base-command.js:306:9)
    at async PerformTasksCommand.invoke (/aws-org-infrastructure/node_modules/aws-organization-formation/dist/src/commands/base-command.js:109:13)
error Command failed with exit code 1.

with the old version 1.0.11 I got this error:

$ /aws-org-infrastructure/node_modules/.bin/org-formation validate-tasks organization-task.yml --profile XXXX_PROFILE
👋 Enter MFA code for arn:aws:iam::999999999999:mfa/device_xx:
(node:34115) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:34115) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
413356
Error: No sso_start_url set for profile XXXX_PROFILE
    at SingleSignOnCredentials.load (/aws-org-infrastructure/node_modules/@mhlabs/aws-sdk-sso/index.js:50:15)
    at SingleSignOnCredentials.coalesceRefresh (/aws-org-infrastructure/node_modules/aws-sdk/lib/credentials.js:205:12)
    at SingleSignOnCredentials.refresh (/aws-org-infrastructure/node_modules/@mhlabs/aws-sdk-sso/index.js:123:10)
    at SingleSignOnCredentials.get (/aws-org-infrastructure/node_modules/aws-sdk/lib/credentials.js:122:12)
    at new SingleSignOnCredentials (/aws-org-infrastructure/node_modules/@mhlabs/aws-sdk-sso/index.js:33:10)
    at InitializeWithProfile.process.env.AWS_SDK_LOAD_CONFIG (/aws-org-infrastructure/node_modules/aws-organization-formation/dist/src/util/aws-util.js:68:23)
    at resolveNext (/aws-org-infrastructure/node_modules/aws-sdk/lib/credentials/credential_provider_chain.js:119:28)
    at /aws-org-infrastructure/node_modules/aws-sdk/lib/credentials/credential_provider_chain.js:126:13
    at /aws-org-infrastructure/node_modules/aws-sdk/lib/credentials.js:124:23
    at /aws-org-infrastructure/node_modules/aws-sdk/lib/credentials.js:212:15
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Error: No sso_start_url set for profile XXXX_PROFILE
    at SingleSignOnCredentials.load (/aws-org-infrastructure/node_modules/@mhlabs/aws-sdk-sso/index.js:50:15)
    at SingleSignOnCredentials.coalesceRefresh (/aws-org-infrastructure/node_modules/aws-sdk/lib/credentials.js:205:12)
    at SingleSignOnCredentials.refresh (/aws-org-infrastructure/node_modules/@mhlabs/aws-sdk-sso/index.js:123:10)
    at SingleSignOnCredentials.get (/aws-org-infrastructure/node_modules/aws-sdk/lib/credentials.js:122:12)
    at resolveNext (/aws-org-infrastructure/node_modules/aws-sdk/lib/credentials/credential_provider_chain.js:125:17)
    at /aws-org-infrastructure/node_modules/aws-sdk/lib/credentials/credential_provider_chain.js:126:13
    at /aws-org-infrastructure/node_modules/aws-sdk/lib/credentials.js:124:23
    at /aws-org-infrastructure/node_modules/aws-sdk/lib/credentials.js:212:15
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
ERROR: unexpected error occurred...
Profile XXXX_PROFILE did not include credential process (use option --print-stack to print stack)
error Command failed with exit code 1.

Your environment

Steps to reproduce

Tell us how to reproduce this issue. Please provide ofn projct files if possible, you can use this template as a base. https://plnkr.co/edit/m568SDw2KPufQsUl

Expected behaviour

Should have asked for the MFA Code.

Actual behaviour

See error msg