Open josefaidt opened 10 months ago
on reproducing this ran into a bit of different error and wasn't reprompted to re-auth sso.
had to re-run aws sso login --profile
, then start the sandbox and destroy the env. The credential_process may be difference in error message
Side note if i rerun sandbox with expired token; the To configure a new Amplify profile, use "npx amplify configure profile".
may need to be changed
npx amplify sandbox --profile amplify-sso-admin
Failed to load aws credentials for profile 'amplify-sso-admin': Token is expired. To refresh this SSO session run 'aws sso login' with the corresponding profile..
To configure a new Amplify profile, use "npx amplify configure profile".
had to re-run aws sso login --profile, then start the sandbox and destroy the env. The credential_process may be difference in error message
Ah yep that's probably why the messages are different
Side note if i rerun sandbox with expired token; the To configure a new Amplify profile, use "npx amplify configure profile". may need to be changed
agreed
Marking as feature-request for error messaging improvements.
We need to surface the same error we throw when the npx amplify sandbox
is first run.
I'm try using sso login at gen2, but raised login error
System:
OS: macOS 12.5
CPU: (20) arm64 Apple M1 Ultra
Memory: 919.31 MB / 128.00 GB
Shell: 3.6.0 - /opt/homebrew/bin/fish
Binaries:
Node: 18.17.0 - ~/.local/share/nvm/v18.17.0/bin/node
Yarn: Not Found
npm: 9.6.7 - ~/.local/share/nvm/v18.17.0/bin/npm
pnpm: Not Found
bun: Not Found
Watchman: Not Found
npmPackages:
@aws-amplify/backend: ^0.10.3 => 0.10.3
@aws-amplify/backend-cli: ^0.10.0 => 0.10.0
aws-amplify: ^6.0.13 => 6.0.13
aws-cdk: ^2.124.0 => 2.124.0
aws-cdk-lib: ^2.124.0 => 2.124.0
typescript: ^5.3.3 => 5.3.3
~/.aws/config
16 [sso-session test]
17 sso_start_url = https://<MY-SSO-LINK>.awsapps.com/start
18 sso_region = ap-northeast-1
19 sso_registration_scopes = sso:account:access
20
21 [profile test]
22 sso_session = test
23 sso_account_id = <I typed SSO_ACCOUNT_ID>
24 sso_role_name = AWSAdministratorAccess
25 region = ap-northeast-1
26 output = json
when this config try to login using create sandbox environment, Failed AWS cred load error.
AWS_PROFILE=test npx amplify sandbox (base)
Failed to load default aws credentials: Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got sso_session, sso_account_id, sso_role_name, region, output
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html.
To configure a new Amplify profile, use "npx amplify configure profile".
Hey @magisystem0408 below is my profile setup for SSO. The error seems a bit odd, but do you experience the same without the output
set?
[profile josef-gen2]
sso_session = josef-gen2
sso_account_id = xxxxx
sso_role_name = AmplifySet
region = us-east-1
[sso-session josef-gen2]
sso_start_url = https://d-9067aede34.awsapps.com/start#
sso_region = us-east-1
sso_registration_scopes = sso:account:access
@josefaidt
thank you feedback!!!.
I tried without output = json
.
Result success and start create sandbox.
[profile josef-gen2]
sso_session = josef-gen2
sso_account_id = xxxxx
sso_role_name = AmplifySet
region = us-east-1
output = json //TODO: delete this property.
[sso-session josef-gen2]
sso_start_url = https://d-9067aede34.awsapps.com/start#
sso_region = us-east-1
sso_registration_scopes = sso:account:access
Ah glad to hear it @magisystem0408 ! 🚀
Environment information
Description
AWS_PROFILE=mysso-profile npx amplify sandbox
cdk destroy
fails (maybe it failed when I was prompted for sso auth)p.s. I realized I have a
credential_process
in my AWS config for the sso profile which may be causing an issue