{"id":20303514,"url":"https://github.com/jacksgt/lambda-layer-tool","last_synced_at":"2025-10-28T06:39:13.498Z","repository":{"id":53491005,"uuid":"250743302","full_name":"jacksgt/lambda-layer-tool","owner":"jacksgt","description":"Build and publish AWS Lambda layers defined in YAML","archived":false,"fork":false,"pushed_at":"2025-01-13T17:16:24.000Z","size":42,"stargazers_count":32,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T14:08:02.357Z","etag":null,"topics":["aws","lambda","lambda-layer","layers","nodejs","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/jacksgt.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,"zenodo":null}},"created_at":"2020-03-28T08:04:06.000Z","updated_at":"2025-03-27T15:21:15.000Z","dependencies_parsed_at":"2025-04-11T13:52:32.697Z","dependency_job_id":"eb1aa922-f494-4cc4-9116-a521058d60e6","html_url":"https://github.com/jacksgt/lambda-layer-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jacksgt/lambda-layer-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksgt%2Flambda-layer-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksgt%2Flambda-layer-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksgt%2Flambda-layer-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksgt%2Flambda-layer-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacksgt","download_url":"https://codeload.github.com/jacksgt/lambda-layer-tool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacksgt%2Flambda-layer-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281397337,"owners_count":26493908,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","lambda-layer","layers","nodejs","python"],"created_at":"2024-11-14T16:37:26.557Z","updated_at":"2025-10-28T06:39:13.493Z","avatar_url":"https://github.com/jacksgt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lambda Layer Tool\n\n![Build status](https://github.com/jacksgt/lambda-layer-tool/workflows/Python%20application/badge.svg?branch=master)\n\nA tool to programmatically build and publish Layers for AWS Lambda.\n\nInstead of manually copy \u0026 pasting build instructions for a Lambda Layer into your shell or trying to script your way around, use this tool to automate the process.\nGiven a simple YAML file, it will:\n* create a new, clean directory for the lambda layer,\n* run specified pre-installation commands,\n* *Python*: install requirements with Pip in a virtual environment,\n* *Node.js*: install dependencies with NPM,\n* strip any binaries and libraries in the lambda directory,\n* apply global and layer-specific exclusion patterns,\n* bundle the remainder up into a ZIP archive.\n\nThen, you can use the tool to publish the new layer (version) on AWS.\n\nFor a full introduction, read the [introductory blog post](https://blog.cubieserver.de/2020/lambda-layer-tool/).\n\nHere is a simple example:\n```yaml\n---\nversion: '0.3'\ndefault_excludes:\n  - '*.dist-info/*'\n  - '*.egg-info/*'\n  - '*/__pycache__/*'\n  - '*.pyc'\nlayers:\n  awesome-numpy:\n    description: 'Minimal numpy 1.18'\n    runtimes: 'python3.6'\n    pre_installs:\n      - 'yum install gcc-gfortran'\n    requirements:\n      - 'numpy==1.18.2'\n    excludes:\n      - '*/numpy/tests/*'\n```\n\nThen just run:\n```\n$ ./layer-tool.py --build awesome-numpy\n[...]\n\n$ du -h awesome-numpy.zip\n13M\n\n$ ./layer-tool.py --publish awesome-numpy\n{\n    \"Content\": {\n        \"Location\": \"https://example.com/aws\",\n        \"CodeSha256\": \"xxQC6FDxg63M5m2UL2cXmChD+dFX7fp61LRrrqmVjGY=\",\n        \"CodeSize\": 13590501\n    },\n    \"LayerArn\": \"arn:aws:lambda:$AWS_REGION:$AWS_ID:layer:awesome-numpy\",\n    \"LayerVersionArn\": \"arn:aws:lambda:$AWS_REGION:$AWS_ID:layer:awesome-numpy:1\",\n    \"Description\": \"Minimal numpy 1.18 for python3.7\",\n    \"CreatedDate\": \"2020-03-28T07:40:49.714+0000\",\n    \"Version\": 1,\n    \"CompatibleRuntimes\": [\n        \"python3.7\"\n    ]\n}\n```\n\nTo learn how to use this tool to reduce the size of your layers, read the [post about creating a minimal boto3 layer](https://blog.cubieserver.de/2020/building-a-minimal-boto3-lambda-layer/).\n\nThe [`tests` directory](./tests/) also serve as examples how to build layers for different runtimes (Python, Node.js).\n\n## Lambda Environment\n\nTo match the environment of AWS Lambda functions as closely as possible (especially when you use this tool on non-Linux systems), the tool should be run inside a Docker container.\nThe [lambci/lambda Docker image](https://github.com/lambci/docker-lambda) closely resembles the real Lambda environment and is well-suited for this task.\nExample:\n\n```\ndocker run --rm -v \"$PWD:/var/task\" lambci/lambda:build-python3.7 ./layer-tool.py --build awesome-numpy\n```\n\n## Publishing\n\nPublishing assumes you have previously configured the aws-cli to connect to your AWS account.\n\n**Note**: Publishing *always* creates a new version of your layer. For more information see https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html .\n\n## Dependencies\n\nIn addition to the Python dependencies (`requirements.txt`), this tool currently needs the following command line tools:\n\n* aws-cli (aws)\n* find\n* zip\n\n## Limitations\n\nCurrently, this tool only supports building Python layers with Pip and Node.js layer with NPM.\nHowever, it should be fairly straightforward to extend the functionality to other runtimes and package managers.\n\n## License\n\nThis software is license under the [MIT License](https://spdx.org/licenses/MIT.html).\nSee `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksgt%2Flambda-layer-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacksgt%2Flambda-layer-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacksgt%2Flambda-layer-tool/lists"}