@@ -498,6 +498,11 @@ def create_function(cfg, path_to_zip_file, *use_s3, **s3_file):
498498 'Timeout' : cfg .get ('timeout' , 15 ),
499499 'MemorySize' : cfg .get ('memory_size' , 512 ),
500500 'Publish' : True ,
501+ 'VpcConfig' : {
502+ 'VpcId' : cfg .get ('vpc_id' ),
503+ 'SubnetIds' : cfg .get ('subnet_ids' , []),
504+ 'SecurityGroupIds' : cfg .get ('security_group_ids' , []),
505+ },
501506 }
502507 else :
503508 kwargs = {
@@ -510,6 +515,11 @@ def create_function(cfg, path_to_zip_file, *use_s3, **s3_file):
510515 'Timeout' : cfg .get ('timeout' , 15 ),
511516 'MemorySize' : cfg .get ('memory_size' , 512 ),
512517 'Publish' : True ,
518+ 'VpcConfig' : {
519+ 'VpcId' : cfg .get ('vpc_id' ),
520+ 'SubnetIds' : cfg .get ('subnet_ids' , []),
521+ 'SecurityGroupIds' : cfg .get ('security_group_ids' , []),
522+ },
513523 }
514524
515525 if 'environment_variables' in cfg :
@@ -573,6 +583,7 @@ def update_function(cfg, path_to_zip_file, *use_s3, **s3_file):
573583 'Timeout' : cfg .get ('timeout' , 15 ),
574584 'MemorySize' : cfg .get ('memory_size' , 512 ),
575585 'VpcConfig' : {
586+ 'VpcId' : cfg .get ('vpc_id' ),
576587 'SubnetIds' : cfg .get ('subnet_ids' , []),
577588 'SecurityGroupIds' : cfg .get ('security_group_ids' , []),
578589 },
0 commit comments