File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -943,19 +943,20 @@ def _construct_version(
943943 # However, we need the Lambda function to automatically create a new version
944944 # and use the new layer. By setting the `PublishLambdaVersion` property to true,
945945 # a new Lambda function version will be created when the layer version is updated.
946- for layer in function .Layers :
947- layer_logical_id = get_logical_id_from_intrinsic (layer )
948- if not layer_logical_id :
949- continue
950-
951- layer_resource = resource_resolver .get_resource_by_logical_id (layer_logical_id )
952- if not layer_resource :
953- continue
954-
955- layer_properties = layer_resource .get ("Properties" , {})
956- publish_lambda_version = layer_properties .get ("PublishLambdaVersion" , False )
957- if publish_lambda_version :
958- properties .update ({layer_logical_id : layer_properties })
946+ if function .Layers :
947+ for layer in function .Layers :
948+ layer_logical_id = get_logical_id_from_intrinsic (layer )
949+ if not layer_logical_id :
950+ continue
951+
952+ layer_resource = resource_resolver .get_resource_by_logical_id (layer_logical_id )
953+ if not layer_resource :
954+ continue
955+
956+ layer_properties = layer_resource .get ("Properties" , {})
957+ publish_lambda_version = layer_properties .get ("PublishLambdaVersion" , False )
958+ if publish_lambda_version :
959+ properties .update ({layer_logical_id : layer_properties })
959960
960961 logical_dict = properties
961962 else :
You can’t perform that action at this time.
0 commit comments