Open trivikr opened 9 months ago
The new instance creation of AWS.Credentials class is not replaced.
Examples
import AWS from "aws-sdk"; // credentials object as options const creds = new AWS.Credentials({ accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session', });
import AWS from "aws-sdk"; // credentials as options const creds = new AWS.Credentials('akid', 'secret', 'session');
Replace new instance with Credentials object with a comment that it's the best guess from codemod.
const creds = { accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session', };
Wait for JS SDK v3 to provide fromStatic credential provider https://github.com/aws/aws-sdk-js-v3/issues/5452
Examples usages in production:
https://github.com/askrella/whatsapp-chatgpt/blob/3096f7db393a3b5a4e1cd70c64349909b7f9cc8e/src/providers/aws.ts#L10
Self-service
Problem
The new instance creation of AWS.Credentials class is not replaced.
Examples
Solution
Replace new instance with Credentials object with a comment that it's the best guess from codemod.
Alternatives
Wait for JS SDK v3 to provide fromStatic credential provider https://github.com/aws/aws-sdk-js-v3/issues/5452
Additional context
Examples usages in production: