Open ChristopheBougere opened 3 years ago
I found this issue because I wanted to inject custom credentials to the data api client which I use via the typeorm-aurora-data-api-driver
. In my project I already migrated to the aws-sdk v3.
However, it seems that @aws-sdk/credential-providers
is somewhat compatible with aws-sdk
v2.
The following works for me:
// Import from AWS SDK v3
import { fromIni } from '@aws-sdk/credential-providers';
const { AWS_PROFILE: profile } = process.env;
const options = {
// ... other options
// Passed to the AWS SDK V2 RDSDataClient
serviceConfiguration: {
credentialProvider: fromIni({ profile }) // this works ✅
}
}
Maybe that helps somebody with the same issue :). However, I am looking forward when this package is migrated to the AWS SDK v3 ✨.
The V3 of the SDK is now generally available (see blog post).
It would be great to be able to use it in this package.
In order to keep the v2 compatibility, we could provide the client during initialization instead of requiring it in this package:
Instead of: