diff --git a/javascriptv3/example_code/dynamodb/tests/update-item.integration.test.js b/javascriptv3/example_code/dynamodb/tests/update-item.integration.test.js index 25600fc428c..fb470b22a45 100644 --- a/javascriptv3/example_code/dynamodb/tests/update-item.integration.test.js +++ b/javascriptv3/example_code/dynamodb/tests/update-item.integration.test.js @@ -27,6 +27,7 @@ describe("update-item", () => { const command = new GetCommand({ TableName: tableName, Key: { Flavor: "Vanilla" }, + ConsistentRead: true, }); const beforeResponse = await client.send(command); diff --git a/javascriptv3/example_code/lambda/README.md b/javascriptv3/example_code/lambda/README.md index d5ce1292494..977bf761910 100644 --- a/javascriptv3/example_code/lambda/README.md +++ b/javascriptv3/example_code/lambda/README.md @@ -51,7 +51,7 @@ Code excerpts that show you how to call individual service functions. - [Invoke](actions/invoke.js#L5) - [ListFunctions](actions/list-functions.js#L5) - [UpdateFunctionCode](actions/update-function-code.js#L15) -- [UpdateFunctionConfiguration](actions/update-function-configuration.js#L12) +- [UpdateFunctionConfiguration](actions/update-function-configuration.js#L14) ### Scenarios diff --git a/javascriptv3/example_code/lambda/actions/update-function-configuration.js b/javascriptv3/example_code/lambda/actions/update-function-configuration.js index da698a6077e..3aa2013cedc 100644 --- a/javascriptv3/example_code/lambda/actions/update-function-configuration.js +++ b/javascriptv3/example_code/lambda/actions/update-function-configuration.js @@ -3,9 +3,11 @@ import { LambdaClient, UpdateFunctionConfigurationCommand, + waitUntilFunctionUpdated, } from "@aws-sdk/client-lambda"; import { readFileSync } from "node:fs"; import { dirnameFromMetaUrl } from "@aws-doc-sdk-examples/lib/utils/util-fs.js"; +import { waitForFunctionUpdated } from "../waiters/index.js"; const dirname = dirnameFromMetaUrl(import.meta.url); @@ -17,7 +19,9 @@ const updateFunctionConfiguration = (funcName) => { ...JSON.parse(config), FunctionName: funcName, }); - return client.send(command); + const result = client.send(command); + waitForFunctionUpdated({ FunctionName: funcName }); + return result; }; /** snippet-end:[javascript.v3.lambda.actions.UpdateFunctionConfiguration] */