I've written a basic Ballerina function and attempted to deploy as AWS Lambda.
AWS reports a permissions error when I try to add the Lambda layer (using the published ARN link - https://ballerina.io/deployment/aws-lambda/#ballerina-aws-lambda-layer-compatibility-matrix)
The error is
not authorised to perform lambda:GetLayerVersion on resource: arn:aws:lambda:eu-west-1:141896495686:layer:ballerina-0-990-3:4
I'm using eu-west-1 region. I've also tried us-west-1.
I've checked and my lambda execution role does include GetLayerVersion permission. I've also check that I can add alternative public layers successfully. For example the custom node11 runtime from https://github.com/lambci/node-custom-lambda
arn:aws:lambda:eu-west-1:553035198032:layer:nodejs11:11
can be added and saved without the same permission error.
This suggests the ballerina layer may not have appropriately public permissions. I'm just exploring so happy to deploy my own private layer if the runtime package can be shared.
We have created layers for all the regions but unfortunately, permissions were not set for all the regions. Above error is causing due to that and now we have fixed it. You can following Layers and please try again.
arn:aws:lambda:eu-west-1:141896495686:layer:ballerina-0-990-3:4
arn:aws:lambda:us-west-1:141896495686:layer:ballerina-0-990-3:4
Also you should be able to use any layer by replacing the region part of following ARN as specified in the website
arn:aws:lambda:<region to be replaced>:141896495686:layer:ballerina-0-990-3:4
Update for 1.0 onward releases
For 1.0 onward releases you need to use following layer. Now there are no release specific layers you can use same layer for new releases as well
aws lambda update-function-configuration --function-name <FUNCTION_NAME> --layers arn:aws:lambda:<REGION_ID>:141896495686:layer:ballerina:2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With