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

Update aws-sdk v2 to v3 #684

Open
gty3 opened this issue Aug 11, 2022 · 0 comments
Open

Update aws-sdk v2 to v3 #684

gty3 opened this issue Aug 11, 2022 · 0 comments

Comments

@gty3
Copy link

gty3 commented Aug 11, 2022

I don't know if you'd want this done, I think all that'd need updating is

_chapters/add-an-api-to-create-a-note

// import AWS from "aws-sdk";

// const client = new AWS.DynamoDB.DocumentClient();

// export default {
//   get: (params) => client.get(params).promise(),
//   put: (params) => client.put(params).promise(),
//   query: (params) => client.query(params).promise(),
//   update: (params) => client.update(params).promise(),
//   delete: (params) => client.delete(params).promise(),
// };
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";

const dbClient = new DynamoDBClient({});
const client = new DynamoDBDocument.from(dbClient);

export default {
  get: async (params) => await client.get(params),
  put: async (params) => await client.put(params),
  query: async (params) => await client.query(params),
  update: async (params) => await client.update(params),
  delete: async (params) => await client.delete(params)
};

_chapters/setup-error-logging-in-serverless

// import AWS from "aws-sdk";
// AWS.config.logger = { log: debug };

// Log AWS SDK calls
import { DynamoDB } from "@aws-sdk/client-dynamodb";
const dynamodb = new DynamoDB();
dynamodb.config.logger = debug;

This is in regards to this discord issue where the user's bundle size is too large , aws-sdk v3 packages are much smaller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant