Skip to content

Update aws-sdk v2 to v3 #684

@gty3

Description

@gty3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions