Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CredentialsError: Missing credentials in config #18

Closed
whizyrel opened this issue Aug 13, 2022 · 1 comment
Closed

CredentialsError: Missing credentials in config #18

whizyrel opened this issue Aug 13, 2022 · 1 comment

Comments

@whizyrel
Copy link

whizyrel commented Aug 13, 2022

I can not seem to get this fixed. Below is the error I get even when the config is loaded in the module initialization.
UnhandledPromiseRejectionWarning: CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1

This is an impl snippet:

@Module({
  imports: [
    AwsSdkModule.forRootAsync({
      services: [SecretsManager, STS],
      defaultServiceOptions: {
        useFactory: (config: ConfigService) => {
          const awsConfig = config.get<IAWSConfig>('aws');

          return {
            region: awsConfig.general.region,
            credentials: new Credentials(
              awsConfig.keys.accessKeyId,
              awsConfig.keys.secretAccessKey,
            ),
          };
        },
        imports: [ConfigModule],
        inject: [ConfigService],
      },
    }),
    ConfigModule.forRoot({
      isGlobal: true,
      load: [...],
    }),
  ],
});

Alas, Somebody help!

@KerryRitter @benMain

Btw, none of the other options worked (same error) including statically providing the config. Also, the project runs in a docker container

@KerryRitter
Copy link
Member

Hi @whizyrel, I haven't really encountered this error so I don't have any recommendations. If you can post a repo I can take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants