Skip to content

Commit

Permalink
docs: migrate AWS SDK for JavaScript v2 APIs to v3 (#5829)
Browse files Browse the repository at this point in the history
Migrating AWS SDK for JavaScript APIs from v2 to v3 in docs were missed in #5583

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
  • Loading branch information
trivikr authored Jun 3, 2024
1 parent eef2df1 commit 83a0be3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions site/content/docs/developing/addons/package.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ This architecture could be useful if you have a service that needs to minimize l
4. Write your lambda function:
```js title="lambdas/record-processor/index.js"
"use strict";
const AWS = require('aws-sdk');
const { unmarshall } = require('@aws-sdk/util-dynamodb');
exports.handler = async function (event, context) {
for (const record of event?.Records) {
Expand All @@ -132,7 +132,7 @@ This architecture could be useful if you have a service that needs to minimize l
}
// process new records
const item = AWS.DynamoDB.Converter.unmarshall(record?.dynamodb?.NewImage);
const item = unmarshall(record?.dynamodb?.NewImage);
console.log("processing item", item);
}
};
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/developing/addons/package.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ zip が必要な一部のリソース (`AWS::Serverless::Function` など) で
4. Lambda 関数を書いてください。
```js title="lambdas/record-processor/index.js"
"use strict";
const AWS = require('aws-sdk');
const { unmarshall } = require('@aws-sdk/util-dynamodb');
exports.handler = async function (event, context) {
for (const record of event?.Records) {
Expand All @@ -134,7 +134,7 @@ zip が必要な一部のリソース (`AWS::Serverless::Function` など) で
}
// process new records
const item = AWS.DynamoDB.Converter.unmarshall(record?.dynamodb?.NewImage);
const item = unmarshall(record?.dynamodb?.NewImage);
console.log("processing item", item);
}
};
Expand Down

0 comments on commit 83a0be3

Please sign in to comment.