serverless-offline
serverless-offline copied to clipboard
Layer download issue
Working with Layers in AWS encountered an issue trying to execute the lambda in local environment. It appears the ARN is not being passed correctly when it tries to download and create a folder. But it works correctly when it gets deployed to AWS instances.
Tracking down the issue it seems that the DockerContainer.js file in the method _downloadLayer receives an inccorrect parameter.
Stacktrace: offline: Found layers, checking provider type offline: Found layers, checking provider type offline: Storing layers at /home/walter.fernandez/code/distribution-serverless-product/.serverless-offline/layers/1d519f58f635a45ca77575ee4b8ed4c9fe588b7bbf0710187972f8f3fe6e16d0 offline: Getting layers offline: Failure: layerArn.split is not a function TypeError: layerArn.split is not a function
Version: Serverless-offline 7.0.0
Please can anyone help me solve this issue.
Do you build the layer ARN dynamically via "Ref" + "logicalId"? (I have the same problem!) If so I can't see any easy solutions. But I don't know all the intricacies of the code.
layers: [
{ Ref: 'NodeJSLambdaLayer' }
]
My unsplittable layerArn is { Ref: 'NodeJSLambdaLayer' }
Did you find any workaround for this issue?
anyone I have the same issue
seem that it not works when I import layers like
layers:
- { Ref: TestLambdaLayer }
it works for me when i changed to paste the arn of layer copied from aws console.
layers:
- arn:aws:lambda:region:XXXXXX:layer:LayerName:Y