{"id":20603685,"url":"https://github.com/patrickm663/aws-lambda-layer-generator","last_synced_at":"2025-04-15T02:06:24.685Z","repository":{"id":153371730,"uuid":"573121391","full_name":"patrickm663/aws-lambda-layer-generator","owner":"patrickm663","description":"Creates Python zip file layers for AWS Lambda","archived":false,"fork":false,"pushed_at":"2024-06-18T18:26:31.000Z","size":230125,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T02:05:58.206Z","etag":null,"topics":["aws","aws-lambda","python3"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/patrickm663.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":"2022-12-01T18:40:59.000Z","updated_at":"2025-02-19T01:12:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d524ade-c4da-4fec-8199-7363af91c429","html_url":"https://github.com/patrickm663/aws-lambda-layer-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickm663%2Faws-lambda-layer-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickm663%2Faws-lambda-layer-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickm663%2Faws-lambda-layer-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickm663%2Faws-lambda-layer-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickm663","download_url":"https://codeload.github.com/patrickm663/aws-lambda-layer-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991545,"owners_count":21194894,"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","aws-lambda","python3"],"created_at":"2024-11-16T09:18:09.529Z","updated_at":"2025-04-15T02:06:24.649Z","avatar_url":"https://github.com/patrickm663.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utility for Creating Custom Python Layers for AWS Lambda\nThis is a simple utility for adding user-defined packages to a Python 3.8-3.12 (latest at time of writing) AWS Lambda layer. The script spins up a Python3.X-slim Docker image to install and zip the packages you need.\n\nPlease note existing limitations of AWS Lambda such as the 250MB layer limit.\n\n**For ease-of-use, a demo layer can be found in the `output-layer/` folder. This contains Numpy for the Python 3.12 runtime.**\n\n## Prerequisites\n- A UNIX environment to run the shell script\n- Docker installed and running\n\n**On Windows, be sure to use `Git Bash` in order to run the Bash script**\n\n## Usage\n1.  Clone the repository:\n```\ngit clone https://github.com/patrickm663/aws-lambda-layer-generator.git\n```\n2.  Enter the directory:\n```\ncd aws-lambda-layer-generator\n```\n3. Update the `requirements.txt` file in `src` to indicate the packages you wish to include in your layer (like you would an ordinary `requirements.txt` file):\n```\nvim src/requirements.txt\n```\n4. (Optional) Set the shell script `create-layer.sh` as executable:\n```\nchmod +x create-layer.sh\n```\n5. Run the script (using `sudo` if required by your Docker set-up):\n```\n./create-layer.sh\n```\n6. Follow the prompt to select the Python version.\n7. Retrieve the zip file in `output-layer/`, titled `python-layer3-X.zip`.\n\n_Note: the current commands are set to **overwrite** `python-layer3-X.zip` each time the script is run._\n\n8. Add the zip file as a layer in AWS Lambda, using S3 where needed.\n\n## Hacking\nSince this is just a Bash script doing find and-replace on a central Dockerfile (`Dockerfile_master`), users can edit the script as they please. This also means users can find-and-replace manually if they only want to use a fixed Python distribution (say, Python 3.12). The rest of the commands to build the container, copy the layer, and clean-up can be done manually or embedded as part of a larger automation piece.\n\n## Contributing\nPull requests are welcome and encouraged!\n\n## License\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickm663%2Faws-lambda-layer-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickm663%2Faws-lambda-layer-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickm663%2Faws-lambda-layer-generator/lists"}