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

[Feature]: Replace AWS.Credentials new instance creation with the credentials object #687

Open
1 task
trivikr opened this issue Nov 6, 2023 · 1 comment
Labels
enhancement New feature or request p2 This is a standard priority issue

Comments

@trivikr
Copy link
Member

trivikr commented Nov 6, 2023

Self-service

  • I'd be willing to implement this feature

Problem

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');

Solution

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',
};

Alternatives

Wait for JS SDK v3 to provide fromStatic credential provider aws/aws-sdk-js-v3#5452

Additional context

Examples usages in production:

@trivikr trivikr added the enhancement New feature or request label Nov 6, 2023
@trivikr trivikr added the p2 This is a standard priority issue label Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

1 participant