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 205a7a3 commit d408928Copy full SHA for d408928
lambda-sns-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 sns = new AWS.SNS({apiVersion: '2012-11-05'})
+const { SNSClient, PublishCommand } = require('@aws-sdk/client-sns')
+
+const snsClient = new SNSClient({
8
+ region: process.env.AWS_REGION
9
+})
10
11
// The Lambda handler
12
exports.handler = async (event) => {
@@ -16,6 +18,6 @@ exports.handler = async (event) => {
16
18
}
17
19
20
// Send to SNS
- const result = await sns.publish(params).promise()
21
+ const result = await snsClient.send(new PublishCommand(params))
22
console.log(result)
-}
23
+}
0 commit comments