agutoli / serverless-layers

Serverless.js plugin implementing AWS Lambda Layers, reducing lambda size, warm-up, and deployment time.
MIT License
229 stars 54 forks source link

Resource not defined when no functions present #96

Closed srdcarrion closed 1 year ago

srdcarrion commented 2 years ago

I want to deploy just layers. I.e. no functions or resources included. When doing so this error fires:

The CloudFormation template is invalid: Template format error: At least one Resources member must be defined.

On review of the template in ./.serverless/ there is no resources. I can only get around this by adding a dummy resource to the serverless.yaml:

resources:
  Resources:
    NullResource:
      Type: AWS::CloudFormation::WaitConditionHandle

I'd expect to see a "AWS::Lambda::LayerVersion" resource type.

Any reason why this might be the case?

agutoli commented 1 year ago

Yeah, the serverless itself validates if you have at least one resource to deploy (it is not related to this plugin).