Skip to content

Commit 4aef6ea

Browse files
author
Marcel Radischat
committed
Update function configuration after deploy
Each time a change is made in the `config.yaml` and the `lambda deploy` is invoked, the changed parameters were not updated for the new version. This commit changes the default behaviour to also update the function configuration with each deploy.
1 parent bc7d528 commit 4aef6ea

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

aws_lambda/aws_lambda.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ def update_function(cfg, path_to_zip_file):
273273
aws_access_key_id = cfg.get('aws_access_key_id')
274274
aws_secret_access_key = cfg.get('aws_secret_access_key')
275275

276+
account_id = get_account_id(aws_access_key_id, aws_secret_access_key)
277+
role = get_role_name(account_id, cfg.get('role', 'lambda_basic_execution'))
278+
276279
client = get_client('lambda', aws_access_key_id, aws_secret_access_key,
277280
cfg.get('region'))
278281

@@ -282,6 +285,15 @@ def update_function(cfg, path_to_zip_file):
282285
Publish=True
283286
)
284287

288+
client.update_function_configuration(
289+
FunctionName=cfg.get('function_name'),
290+
Role=role,
291+
Handler=cfg.get('handler'),
292+
Description=cfg.get('description'),
293+
Timeout=cfg.get('timeout', 15),
294+
MemorySize=cfg.get('memory_size', 512)
295+
)
296+
285297

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

0 commit comments

Comments
 (0)