We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d3ceb2 commit 793c4abCopy full SHA for 793c4ab
lambda-sqs-terraform/src/app.js
@@ -2,9 +2,11 @@
2
* SPDX-License-Identifier: MIT-0
3
*/
4
5
-const AWS = require('aws-sdk')
6
-AWS.config.region = process.env.AWS_REGION
7
-const sqs = new AWS.SQS({apiVersion: '2012-11-05'})
+const { SQSClient, SendMessageCommand } = require('@aws-sdk/client-sqs')
+
+const sqsClient = new SQSClient({
8
+ region: process.env.AWS_REGION
9
+})
10
11
// The Lambda handler
12
exports.handler = async (event) => {
@@ -15,6 +17,7 @@ exports.handler = async (event) => {
15
17
}
16
18
19
// Send to SQS
- const result = await sqs.sendMessage(params).promise()
20
+ const command = new SendMessageCommand(params)
21
+ const result = await sqsClient.send(command)
22
console.log(result)
-}
23
+}
0 commit comments