{"id":28126035,"url":"https://github.com/pietrogiuffrida/lambda_layers","last_synced_at":"2026-04-11T05:33:48.605Z","repository":{"id":144097422,"uuid":"248941659","full_name":"pietrogiuffrida/lambda_layers","owner":"pietrogiuffrida","description":"Bash scripts to create aws lambda layers for python","archived":false,"fork":false,"pushed_at":"2020-05-06T21:14:29.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T03:01:45.513Z","etag":null,"topics":["aws","bash","docker","lambda","lambda-layer","python","ubuntu"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pietrogiuffrida.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-03-21T09:12:05.000Z","updated_at":"2020-05-06T21:14:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"4eb9f7be-f63f-4400-82d5-e6b3606755d2","html_url":"https://github.com/pietrogiuffrida/lambda_layers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pietrogiuffrida/lambda_layers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietrogiuffrida%2Flambda_layers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietrogiuffrida%2Flambda_layers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietrogiuffrida%2Flambda_layers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietrogiuffrida%2Flambda_layers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pietrogiuffrida","download_url":"https://codeload.github.com/pietrogiuffrida/lambda_layers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pietrogiuffrida%2Flambda_layers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31670022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"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","bash","docker","lambda","lambda-layer","python","ubuntu"],"created_at":"2025-05-14T10:23:06.629Z","updated_at":"2026-04-11T05:33:48.595Z","avatar_url":"https://github.com/pietrogiuffrida.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lambda_layers\nBash scripts to create aws lambda layers for python\n\nThis is a simple collection of bash scripts that can save yout life if you want create layers inside aws lambda.\nLayers are building blocks of code that can be included in a lambda code. With layers your lambda package can use more and more code and you can exceed limits of space imposed to the code directly pushed in a lambda package. You can read more in the official documentation:\n- [What Is AWS Lambda?](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html)\n- [AWS Lambda Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\n- [AWS Lambda Limits](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)\n- [Hosting your ML model on AWS Lambdas ](https://towardsdatascience.com/hosting-your-ml-model-on-aws-lambdas-api-gateway-part-1-9052e6b63b25)\n\nScripts contained in this repository has been tested only in a Ubuntu bionic EC2 instance.\n\nRequirements are described in the following sections.\n\n## Getting Started\n\n### Step 1: configuration\nBash scripts in this repository make use of [AWS CLI 2](https://aws.amazon.com/cli/?nc1=h_ls) and Docker.\nInside the `configuration/` directory you can find two scripts with every steps of their installation.\n\n+ **awscli_configuration.sh** is a very simple, two line scripts, from [official documentation]( https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html). It require sudo privileges.\nAfter installing aws cli, you must configure it with credentials of your aws account. You can follow [official documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html), or simply run:\n```$ aws configure```\n\n+ **install_docker.sh** is a bit more complex. Commands contained inside this scripts are from \n[docker documentation](#https://docs.docker.com/install/linux/docker-ce/ubuntu/).\nFollowing this code you can easily install docker from official repositories.\n\n### Step 2: create a layer\nYou can find two example layers (pandas and scikit-learn) and a `clean/` directory, that can be copied to create other layers.\nIn each of this directories the only file that must be edited is `config.sh`, that contains some variable definitions:\n```\nLAYER_NAME='layer_pandas_0_25_3.zip'\nDESCRIPTION=\"pandas 0.25.3 for python 3.7.6\"\n\n# A LIST OF PACKAGE TO INSTALL, SPACE SEPARATED\nPACKAGES=\"pandas==0.25.3\"\n\nRUNTIMES=\"python3.7\"\n```\n\n+ `LAYER_NAME` will be used either as the name of the layer during the upload (after basename-ing it) and as the name of the zip file that will be uploaded. My suggestion is to be as explicit as possible and adopt a name that describe the real content of the layer.\n+ `DESCRIPTION` is a short text attached to the layer in AWS.\n+ `PACKAGES` is a list of python packages that will be installed inside the layer from pip. This string will be directly passed to pip, inside the docker, than you can write here what you normally write as pip list of packages.\n+ `RUNTIMES` is one or more from available aws runtimes. If you want change runtimes, you must edit also the script `10_build_layer_from_docker.sh`, that is in charge to run the docker image of the same runtime, and `build_layer_inside_docker.sh`, where the path of the runtime is part of pip install process.\n\nAfter these steps, you can run:\n1. `10_build_layer_from_docker.sh`\n2. `20_upload_layer_to_aws.sh`\n\nThe first script (download if not already done and) run the docker image that emulate aws lambda environment. The same script ask the image to run the script `build_layer_inside_docker.sh`, which is the core, because contains the `pip install...` command with which python packages are downloaded from pypi and installed in a local directory, and the zip command to create the layer. Also this scipts follows `config.sh` instructions.\n\nAfter running `10_build_layer_from_docker.sh`, inside the `pandas/` directory you can find the `layer_pandas_0_25_3.zip` file, that is a zip of the dirtree created by pip.\n\nThe second script, `20_upload_layer_to_aws.sh` simply run `aws lambda publish-layer-version` whit several options filled from `config.sh`. The stdout of the command are redirected to the upload.log file. Stderr is showed at screen.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpietrogiuffrida%2Flambda_layers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpietrogiuffrida%2Flambda_layers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpietrogiuffrida%2Flambda_layers/lists"}