aws-sdk-js-codemod icon indicating copy to clipboard operation
aws-sdk-js-codemod copied to clipboard

[Feature]: Looking for codemod to be able to convert below examples

Open abhirpat opened this issue 2 years ago • 2 comments
trafficstars

Self-service

  • [ ] I'd be willing to implement this feature

Problem

const AWS = require('aws-sdk');

credentials = new AWS.EC2MetadataCredentials()

credentials = new AWS.EnvironmentCredentials('AWS');

credentials = new AWS.SharedIniFileCredentials({...);

const endpoint = new AWS.Endpoint(uri.host);

const req = new AWS.HttpRequest(endpoint);

const signer = new AWS.Signers.V4(req, 'es');
signer.addAuthorization(credentials, new Date());

const send = new AWS.NodeHttpClient();

Solution

The codemode to convert them to V3 https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/migrating-to-v3.html

Alternatives

N/A

Additional context

No response

abhirpat avatar Sep 19 '23 17:09 abhirpat

Transformation for Credentials was added in https://github.com/awslabs/aws-sdk-js-codemod/pull/598

trivikr avatar Oct 23 '23 15:10 trivikr

AWS.Endpoint is also used in nocodb

https://github.com/search?q=repo%3Anocodb%2Fnocodb%20AWS.Endpoint&type=code

trivikr avatar Nov 05 '23 01:11 trivikr