Skip to content

Commit e7b17e4

Browse files
committed
Make function publishing the last step
We want to publish the function after updating the config, so the newly created versions pick up an eventually updated function description.
1 parent 9e879c8 commit e7b17e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aws_lambda/aws_lambda.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def update_function(cfg, path_to_zip_file):
282282
client.update_function_code(
283283
FunctionName=cfg.get('function_name'),
284284
ZipFile=byte_stream,
285-
Publish=True
285+
Publish=False
286286
)
287287

288288
client.update_function_configuration(
@@ -294,6 +294,11 @@ def update_function(cfg, path_to_zip_file):
294294
MemorySize=cfg.get('memory_size', 512)
295295
)
296296

297+
# Publish last, so versions pick up eventually updated description...
298+
client.publish_version(
299+
FunctionName=cfg.get('function_name')
300+
)
301+
297302

298303
def function_exists(cfg, function_name):
299304
"""Check whether a function exists or not"""

0 commit comments

Comments
 (0)