-
Notifications
You must be signed in to change notification settings - Fork 14
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
Issue with .forRootAsync #3
Comments
@KerryRitter fix this! |
Try it @Module({
imports: [
AwsSdkModule.forRootAsync({
defaultServiceOptions: {
inject: [ConfigService],
useFactory: (configService) => ({
credentials: {
accessKeyId: configService.get('scaleway.ACCESS_KEY_ID'),
secretAccessKey: configService.get('scaleway.SECRET_ACCESS_KEY'),
},
region: configService.get('scaleway.REGION'),
endpoint: configService.get('scaleway.ENDPOINT'),
}),
},
services: [S3],
}),
],
}) PS: Double-check for import "configService" from "@nestjs/config" (just an example config) |
After a lot of headaches with this plugin and others that propose to be a wrapper between nestjs and aws-sdk, I decided to configure the dependency injection by myself and the result was not bad. https://gist.github.com/felinto-dev/0450a3484ddd8aefefc79f42797eeadf |
Sorry to hear you had problems. Are your issues related to what @benMain posted? Looks like you supply the default options. That said, your solution is how I would approach the problem without nest-aws-sdk. |
Thank you so much @felinto-dev for the code snippet.
But now, using your method, worked for me. |
During module initialization, if I provide serviceProviders but not the optional defaultServiceOptions the code returns before adding my serviceProviders to the Providers and exports of the dynamic modules
The text was updated successfully, but these errors were encountered: