@staticmethod<EOL><INDENT>def _parse_layer_info(list_of_layers, resources):<DEDENT>
layers = []<EOL>for layer in list_of_layers:<EOL><INDENT>if isinstance(layer, six.string_types):<EOL><INDENT>layers.append(LayerVersion(layer, None))<EOL>continue<EOL><DEDENT>if isinstance(layer, dict) and layer.get("<STR_LIT>"):<EOL><INDENT>layer_logical_id = layer.get("<STR_LIT>")<EOL>layer_resource = resources.get(layer_logical_id)<EOL>if not layer_resource orlayer_resource.get("<STR_LIT>", "<STR_LIT>") not in (SamFunctionProvider._SERVERLESS_LAYER,<EOL>SamFunctionProvider._LAMBDA_LAYER):<EOL><INDENT>raise InvalidLayerReference()<EOL><DEDENT>layer_properties = layer_resource.get("<STR_LIT>", {})<EOL>resource_type = layer_resource.get("<STR_LIT>")<EOL>codeuri = None<EOL>if resource_type == SamFunctionProvider._LAMBDA_LAYER:<EOL><INDENT>codeuri = SamFunctionProvider._extract_lambda_function_code(layer_properties, "<STR_LIT>")<EOL><DEDENT>if resource_type == SamFunctionProvider._SERVERLESS_LAYER:<EOL><INDENT>codeuri = SamFunctionProvider._extract_sam_function_codeuri(layer_logical_id,<EOL>layer_properties,<EOL>"<STR_LIT>")<EOL><DEDENT>layers.append(LayerVersion(layer_logical_id, codeuri))<EOL><DEDENT><DEDENT>return layers<EOL>
Creates a list of Layer objects that are represented by the resources and the list of layers

Parameters
----------
list_of_layers List(str)
    List of layers that are defined within the Layers Property on a function
resources dict
    The Resources dictionary defined in a template

Returns
-------
List(samcli.commands.local.lib.provider.Layer)
    List of the Layer objects created from the template and layer list defined on the function. The order
    of the layers does not change.

    I.E: list_of_layers = ["layer1", "layer2"] the return would be [Layer("layer1"), Layer("layer2")]