I'm trying to create a [layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from an [AWS Lambda Application](https://docs.aws.amazon.com/lambda/latest/dg/deploying-lambda-apps.html) and reference that layer from another AWS Lambda Application.

I have the first application creating the layer.

Application template.yml

[![template.yml](https://i.stack.imgur.com/8w2tV.png)](https://i.stack.imgur.com/8w2tV.png)

index.js for layer

[![enter image description here](https://i.stack.imgur.com/TmcPl.png)](https://i.stack.imgur.com/TmcPl.png)

Layer in AWS Console

[![enter image description here](https://i.stack.imgur.com/WnDT7.png)](https://i.stack.imgur.com/WnDT7.png)

Zip of the layer

[![enter image description here](https://i.stack.imgur.com/eaiAo.png)](https://i.stack.imgur.com/eaiAo.png)

When I reference the layer from my other application I get the following build error.

[![enter image description here](https://i.stack.imgur.com/9IQpB.png)](https://i.stack.imgur.com/9IQpB.png)

template.yml for other application
[![enter image description here](https://i.stack.imgur.com/m69PY.png)](https://i.stack.imgur.com/m69PY.png)

I am able to add the layer to the lambda through the aws console.

[![enter image description here](https://i.stack.imgur.com/MZMUG.png)](https://i.stack.imgur.com/MZMUG.png)

[![enter image description here](https://i.stack.imgur.com/RIvT6.png)](https://i.stack.imgur.com/RIvT6.png)

What's the correct way to reference this layer from the template.yml?

Update - debug output

> 
> sam local start-lambda --debug
> 2021-12-16 21:39:37,696 | Telemetry
> endpoint configured to be
> <https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics>
> 2021-12-16 21:39:37,696 | Using config file: samconfig.toml, config
> environment: default 2021-12-16 21:39:37,696 | Expand command line
> arguments to: 2021-12-16 21:39:37,696 |
> --template\_file=C:\Users\bensi\IdeaProjects\tu-record\template.yml --host=127.0.0.1 --port=3001 --layer\_cache\_basedir=C:\Users\bensi\ AppData\Roaming\AWS SAM\layers-pkg --container\_host=localhost
> --container\_host\_interface=127.0.0.1 2021-12-16 21:39:37,949 | local start\_lambda command is called 2021-12-16 21:39:37,955 | Collected
> default values for parameters: {} 2021-12-16 21:39:37 Plugin
> 'ServerlessAppPlugin' raised an exception: 'list' object has no
> attribute 'get' Traceback (most recent call last):  
> 
> File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\plugins\_*init*\_.py",
> line 133, in act
> getattr(plugin, method\_name)(\*args, \*\*kwargs) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\metrics\method\_decorator.py",
> line 96, in wrapper\_cw\_timer
> exec\_result = func(\*args, \*\*kwargs) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\plugins\application\serverless\_app\_plugin.py", line 92, in on\_before\_transfor m\_template
> for logical\_id, app in template.iterate({SamResourceType.Application.value}): File
> "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\sdk\template.py",
> line 33, in iterate
> resource = SamResource(resource\_dict) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\sdk\resource.py",
> line 24, in **init**
> self.type = resource\_dict.get("Type") AttributeError: 'list' object has no attribute 'get' 2021-12-16 21:39:37,973 | Sending
> Telemetry: {'metrics': [{'commandRun': {'requestId':
> 'd4aa74c5-a627-407e-8f65-f86fa97eeb15', 'installationId':
> 'e4cd6d85-622f
> -47df-8c87-08d5d6c395d6', 'sessionId': '80147f0f-42ce-4539-9edd-f08dd86eebcf', 'executionEnvironment': 'CLI',
> 'ci': False, 'pyversion': '3.8.8', 'samcliVersion ': '1.36.0',
> 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '',
> 'commandName': 'sam local start-lambda', 'duration': 277,
> 'exitReason': 'Att ributeError', 'exitCode': 255}}]} 2021-12-16
> 21:39:38,176 | Telemetry response: 200 Traceback (most recent call
> last): File "runpy.py", line 194, in \_run\_module\_as\_main File
> "runpy.py", line 87, in *run\_code File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\_*main**.py",
> line 12, in 
> cli(prog\_name="sam") File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line
> 829, in **call**
> return self.main(\*args, \*\*kwargs) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line
> 782, in main
> rv = self.invoke(ctx) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line
> 1259, in invoke
> return \_process\_result(sub\_ctx.command.invoke(sub\_ctx)) File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line
> 1259, in invoke
> return *process\_result(sub\_ctx.command.invoke(sub\_ctx)) File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line
> 1066, in invoke
> return ctx.invoke(self.callback, \*\*ctx.params) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line
> 610, in invoke
> return callback(\*args, \*\*kwargs) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\decorators.py",
> line 73, in new\_func
> return ctx.invoke(f, obj, \*args, \*\*kwargs) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line
> 610, in invoke
> return callback(\*args, \*\*kwargs) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\telemetry\metric.py",
> line 157, in wrapped
> raise exception # pylint: disable=raising-bad-type File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\telemetry\metric.py",
> line 122, in wrapped File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\providers\sam\_stack\_provider.py",
> line 51, in **init**
> self.*template\_dict = self.get\_template( File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\providers\sam\_base\_provider.py",
> line 189, in get\_template
> template\_dict = SamTranslatorWrapper(template\_dict, parameter\_values=parameters\_values).run\_plugins() File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\samlib\wrapper.py",
> line 68, in run\_plugins
> parser.parse(template\_copy, all\_plugins) # parse() will run all configured plugins File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\samlib\wrapper.py",
> line 88, in parse
> sam\_plugins.act(LifeCycleEvents.before\_transform\_template, sam\_template) File "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\plugins\_*init**.py",
> line 139, in act
> raise ex File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\plugins\_*init**.py",
> line 133, in act
> getattr(plugin, method\_name)(\*args, \*\*kwargs) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\metrics\method\_decorator.py",
> line 96, in wrapper\_cw\_timer
> exec\_result = func(\*args, \*\*kwargs) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\plugins\application\serverless\_app\_plugin.py", line 92, in on\_before\_transfor m\_template
> for logical\_id, app in template.iterate({SamResourceType.Application.value}): File
> "C:\Program
> Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\sdk\template.py",
> line 33, in iterate
> resource = SamResource(resource\_dict) File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samtranslator\sdk\resource.py",
> line 24, in **init**
> self.type = resource\_dict.get("Type") AttributeError: 'list' object has no attribute 'get'
> 
> 
>