tywalch/electrodb

Old dependency on aws-sdk

estyrke opened this issue · 1 comments

Describe the bug
I have recently switched over to AWS SSO auth, with a sso-session section in ~/.aws/config. This results in the following error when I try to run tests:

ElectroError: Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got region, default_region, sso_session, sso_account_id, sso_role_name
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html - For more detail on this error reference: https://github.com/tywalch/electrodb#aws-error

The mentioned missing parameters are used in the "Legacy non-refreshable configuration", which is not recommended according to the reference link (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html).

I assume this error occurs because support for the token-based configuration wasn't added until aws-sdk@2.1253.0 (see https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#212530), but electroDB depends on version 2.630.

ElectroDB Version
2.1.1

ElectroDB Playground Link
N/A

Entity/Service Definitions
N/A

Expected behavior
AWS config with "SSO token provider configuration" (as recommended at https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html) should work without errors.

Errors

ElectroError: Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got region, default_region, sso_session, sso_account_id, sso_role_name
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html - For more detail on this error reference: https://github.com/tywalch/electrodb#aws-error

Oh, never mind. I failed to consider the SDK v3 dependencies in my own repo. Turns out I had a too old version of @aws-sdk/client-dynamodb.