From 2cfc4dac6fff811f1c9ce366b4e73fc51f0ac086 Mon Sep 17 00:00:00 2001 From: Sam Chung Date: Thu, 30 Nov 2023 09:59:52 +1100 Subject: [PATCH] Remove @aws-sdk/util-utf8-node from worker template (#1326) * Remove @aws-sdk/util-utf8-node * Update green-flies-draw.md * pin dep version https://github.com/DataDog/datadog-lambda-js/pull/442#issuecomment-1832715274 --- .changeset/green-flies-draw.md | 5 +++++ template/lambda-sqs-worker/package.json | 3 +-- template/lambda-sqs-worker/src/hooks.ts | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changeset/green-flies-draw.md diff --git a/.changeset/green-flies-draw.md b/.changeset/green-flies-draw.md new file mode 100644 index 000000000..f8a921677 --- /dev/null +++ b/.changeset/green-flies-draw.md @@ -0,0 +1,5 @@ +--- +'skuba': patch +--- + +template/lambda-sqs-worker: Remove `@aws-sdk/util-utf8-node` library diff --git a/template/lambda-sqs-worker/package.json b/template/lambda-sqs-worker/package.json index 7a8be2846..413cb7945 100644 --- a/template/lambda-sqs-worker/package.json +++ b/template/lambda-sqs-worker/package.json @@ -17,9 +17,8 @@ "@aws-sdk/client-codedeploy": "^3.363.0", "@aws-sdk/client-lambda": "^3.363.0", "@aws-sdk/client-sns": "^3.363.0", - "@aws-sdk/util-utf8-node": "^3.259.0", "@seek/logger": "^6.0.0", - "datadog-lambda-js": "^7.0.0", + "datadog-lambda-js": "~7.100.0", "dd-trace": "^4.0.0", "skuba-dive": "^2.0.0", "zod": "^3.19.1" diff --git a/template/lambda-sqs-worker/src/hooks.ts b/template/lambda-sqs-worker/src/hooks.ts index a80a361a6..40c95cf2d 100644 --- a/template/lambda-sqs-worker/src/hooks.ts +++ b/template/lambda-sqs-worker/src/hooks.ts @@ -7,7 +7,6 @@ import { PutLifecycleEventHookExecutionStatusCommand, } from '@aws-sdk/client-codedeploy'; import { InvokeCommand, LambdaClient } from '@aws-sdk/client-lambda'; -import { toUtf8 } from '@aws-sdk/util-utf8-node'; const codeDeploy = new CodeDeployClient({ apiVersion: '2014-10-06', @@ -51,7 +50,7 @@ const smokeTestLambdaFunction = async (): Promise => { if (response.FunctionError) { console.error('Error:', response.FunctionError); if (response.Payload) { - console.error(toUtf8(response.Payload)); + console.error(response.Payload.transformToString()); } return 'Failed'; }