@@ -43705,28 +43705,30 @@ async function run() {
4370543705 if (IMAGE_URI) {
4370643706 updateParams["PackageType"] = "Image";
4370743707 updateParams["ImageUri"] = IMAGE_URI;
43708+ } else {
43709+ updateParamIfPresent("Runtime", RUNTIME);
43710+ updateParamIfPresent("Handler", HANDLER);
43711+ if (ENVIRONMENT) {
43712+ const Variables = JSON.parse(ENVIRONMENT);
43713+ updateParams["Environment"] = { Variables };
43714+ }
4370843715 }
4370943716
4371043717 // add optional params
43711- updateParamIfPresent("Runtime", RUNTIME);
4371243718 updateParamIfPresent("Role", ROLE);
43713- updateParamIfPresent("Handler", HANDLER);
4371443719 updateParamIfPresent("Description", DESCRIPTION);
4371543720 updateParamIfPresent("Timeout", convertOptionalToNumber(TIMEOUT));
4371643721 updateParamIfPresent("MemorySize", convertOptionalToNumber(MEMORY_SIZE));
4371743722 updateParamIfPresent(
4371843723 "Architectures",
4371943724 splitOptional(ARCHITECTURES) || ["x86_64"]
4372043725 );
43721- if (ENVIRONMENT) {
43722- const Variables = JSON.parse(ENVIRONMENT);
43723- updateParams["Environment"] = { Variables };
43724- }
4372543726
4372643727 // https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/UpdateFunctionCodeCommand/
43727- const updateCommand = ZIP
43728- ? new UpdateFunctionCodeCommand(updateParams)
43729- : new UpdateFunctionConfigurationCommand(updateParams);
43728+ const updateCommand =
43729+ ZIP || IMAGE_URI
43730+ ? new UpdateFunctionCodeCommand(updateParams)
43731+ : new UpdateFunctionConfigurationCommand(updateParams);
4373043732 const lambdaClient = new LambdaClient(awsConfig);
4373143733 const response = await lambdaClient.send(updateCommand);
4373243734 console.log(response);
0 commit comments