You’re right about that. Looking into it now.
For the time being, one way to handle this is to have your layer & your service using the layer in different serverless projects.
In your service’s serverless.yml:
service: foobar
provider:
name: aws
language: python3.6
functions:
hello:
handler: handler.hello
layers:
- ${cf:foobar-layer-dev.FoobarLayerExport}
Then in a separate project managing your layer:
service: foobar-layer
provider:
name: aws
layers:
foobar:
path: layer
resources:
Outputs:
FoobarLayerExport:
Value:
Ref: FoobarLambdaLayer
Export:
Name: FoobarLambdaLayer