Skip to content

Commit b4de0d5

Browse files
committed
fixed issue with accessing existing configuration
1 parent 28916f0 commit b4de0d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

aws_lambda/aws_lambda.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,11 @@ def update_function(
637637
}
638638

639639
if preserve_vpc:
640-
kwargs['VpcConfig'] = existing_cfg.get('VpcConfig')
640+
kwargs['VpcConfig'] = existing_cfg.get('Configuration').get('VpcConfig')
641+
if kwargs['VpcConfig'] is None:
642+
kwargs['VpcConfig'] = {}
643+
else:
644+
del kwargs['VpcConfig']['VpcId']
641645
else:
642646
kwargs['VpcConfig'] = {
643647
'SubnetIds': cfg.get('subnet_ids', []),

0 commit comments

Comments
 (0)