{"id":15017042,"url":"https://github.com/moznion/aws-lambda-perl5-layer","last_synced_at":"2025-04-09T19:42:03.137Z","repository":{"id":145077979,"uuid":"159898942","full_name":"moznion/aws-lambda-perl5-layer","owner":"moznion","description":"Perl5 layer for AWS Lambda with runtime API","archived":false,"fork":false,"pushed_at":"2020-03-07T09:01:15.000Z","size":24,"stargazers_count":32,"open_issues_count":1,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-23T21:35:53.186Z","etag":null,"topics":["aws-lambda","custom-runtime","lambda","perl","perl5"],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moznion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-01T01:57:16.000Z","updated_at":"2024-11-27T11:32:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"853114e6-3f51-4ba4-86e0-70af1392ee27","html_url":"https://github.com/moznion/aws-lambda-perl5-layer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Faws-lambda-perl5-layer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Faws-lambda-perl5-layer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Faws-lambda-perl5-layer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Faws-lambda-perl5-layer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/aws-lambda-perl5-layer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248100894,"owners_count":21047870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","custom-runtime","lambda","perl","perl5"],"created_at":"2024-09-24T19:49:43.650Z","updated_at":"2025-04-09T19:42:03.112Z","avatar_url":"https://github.com/moznion.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"aws-lambda-perl5-layer\n==\n\nThis repository provides the Perl5 layer for AWS Lambda with runtime API.\n\nHow to use\n--\n\n### 1. Using provided layers\n\n#### ARN\n\n- `arn:aws:lambda:${REGION}:652718333417:layer:perl-5_26-layer:1`\n- `arn:aws:lambda:${REGION}:652718333417:layer:perl-5_28-layer:1`\n\n##### Supported regions\n\n- ap-northeast-1\n- ap-northeast-2\n- ap-south-1\n- ap-southeast-1\n- ap-southeast-2\n- ca-central-1\n- eu-central-1\n- eu-west-1\n- eu-west-2\n- eu-west-3\n- sa-east-1\n- us-east-1\n- us-east-2\n- us-west-1\n- us-west-2\n\n### 1'. Building a layer yourself\n\nIf you want to build a layer and use that instead of provided layer, please follow the following sequence.\n\n#### How to build a layer\n\n```\n$ make build-docker-image PERL_VERSION=x.x.x CONTAINER_TAG=x.x\n$ make build CONTAINER_TAG=x.x\n```\n\nNOTE: `x.x.x` and `x.x` means perl runtime version (e.g. `5.28.1` and `5.28`). You can specify as you like.\n\nThen this command stats to create a zip archive as `lambda-layer-perl-x.x.zip`.\n\n--\n\nOr you can use pre-built docker container (RECOMMENDED!):\n\n```\n$ make build CONTAINER_TAG=x.x DOCKER_HUB_ACCOUNT='moznion/'\n```\n\nPlease refer to the following so that getting available containers: https://hub.docker.com/r/moznion/lambda-perl-layer-foundation/\n\n#### How to publish the layer\n\n```sh\naws --region \"$REGION\" --profile \"$PROFILE\" lambda publish-layer-version \\\n      --layer-name \"perl-x.x\" \\\n      --zip-file \"fileb://lambda-layer-perl-x.x.zip\"\n```\n\n### 2. Create a Lambda function and publish it\n\nPlease refer: [moznion/aws-lambda-perl5-layer-example](https://github.com/moznion/aws-lambda-perl5-layer-example)\n\nIf you register the handler as `handler.handle`, you have to write code into `handler.pl` file and it must have `handle` subroutine.\n\nAn simple example is below (`handler.pl`):\n\n```perl\n#!perl\n\nuse strict;\nuse warnings;\nuse utf8;\n\nsub handle {\n    my ($payload) = @_;\n\n    # do something\n    ...\n\n    # if you want to finish the execution as failed, please die\n\n    # NOTE: must return hashref or arrayref\n    return +{\n        'msg' =\u003e 'OK',\n        'this is' =\u003e 'example',\n    };\n}\n\n1; # must return TRUE value here!\n```\n\nAnd there is necessary to publish the function with layer information. Please refer to the following example: [How to publish a function](https://github.com/moznion/aws-lambda-perl5-layer-example/tree/master/simple#how-to-publish-a-function)\n\nFAQ\n--\n\n### How to build a Lambda function with package vendoring?\n\nYou have to build a function zip with the perl runtime that is the same version as Lambda's one.\n\nPlease refer: [https://github.com/moznion/aws-lambda-perl5-layer-example/tree/master/simple](https://github.com/moznion/aws-lambda-perl5-layer-example/tree/master/simple)\n\n### How should it do when the runtime complains \"error while loading shared libraries: libXXX.so\"?\n\nProbably this because of the Lambda runtime environment (i.e. base Linux).\n\nThis lambda applies workaround that includes those missing shared libraries.\n\nRef:\n\n- https://github.com/moznion/aws-lambda-perl5-layer/issues/6\n- https://github.com/moznion/aws-lambda-perl5-layer/commit/833ded09dd460ccba08bd4e176a9bc99ff4ec7e1\n\nHowever, I think this way is a little bit fragile... is there any good method?\n\nFor Developers\n--\n\n### How to publish foundation docker container\n\n```\n$ make build-docker-image PERL_VERSION=x.x.x CONTAINER_TAG=x.x\n$ make publish-docker-image CONTAINER_TAG=x.x DOCKER_ID_USER=xxx\n```\n\n### How to build foundation docker container without caching\n\n```\n$ make build-docker-image PERL_VERSION=x.x.x CONTAINER_TAG=x.x OPT='--no-cache'\n```\n\nSee Also\n--\n\n- https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html\n\nAuthor\n--\n\nmoznion (\u003cmoznion@gmail.com\u003e)\n\nLicense\n--\n\n```\nThe MIT License (MIT)\nCopyright © 2018 moznion, http://moznion.net/ \u003cmoznion@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Faws-lambda-perl5-layer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Faws-lambda-perl5-layer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Faws-lambda-perl5-layer/lists"}