Skip to content

Layer is an Invalid Layer Arn, when passing it to a nested Serverless Application #2783

@JohanZackrisson

Description

@JohanZackrisson

Description:

When passing a !Ref to a AWS::Serverless::LayerVersion to a nested AWS::Serverless::Application, sam build returns:
Error: Layer is an Invalid Layer Arn.
when using version 1.21.1

This does not happen in version 1.19.1.

I've minimized a test case, which can be found at:
https://github.com/JohanZackrisson/aws-sam-cli-bug

When passing in a arn string instead of a !Ref, it builds.

Steps to reproduce:

In the main folder do:
Non working test:
pip3 install aws-sam-cli -Iv aws-sam-cli==v1.21.1
sam build

Working test:
pip3 install aws-sam-cli -Iv aws-sam-cli==v1.19.1
sam build

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Mac OS 11.2.3
  2. sam --version: 1.21.1
  3. AWS region: eu-west-1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions