{"id":24360478,"url":"https://github.com/simonsfoundation/serverless-awslambda-container","last_synced_at":"2026-04-06T03:03:10.870Z","repository":{"id":171347168,"uuid":"647746994","full_name":"simonsfoundation/serverless-awslambda-container","owner":"simonsfoundation","description":"Sample repository with code to deploy a custom Ubuntu container to AWS Lambda using the Serverless Framework. ","archived":false,"fork":false,"pushed_at":"2023-06-01T15:42:29.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-18T21:32:29.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonsfoundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-05-31T12:42:28.000Z","updated_at":"2023-05-31T14:10:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"0084f36a-bbbb-4d55-aae0-36b224af3d5f","html_url":"https://github.com/simonsfoundation/serverless-awslambda-container","commit_stats":null,"previous_names":["simonsfoundation/serverless-awslambda-container"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsfoundation%2Fserverless-awslambda-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsfoundation%2Fserverless-awslambda-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsfoundation%2Fserverless-awslambda-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsfoundation%2Fserverless-awslambda-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonsfoundation","download_url":"https://codeload.github.com/simonsfoundation/serverless-awslambda-container/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243188204,"owners_count":20250452,"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":[],"created_at":"2025-01-18T21:29:53.655Z","updated_at":"2025-12-28T06:28:45.737Z","avatar_url":"https://github.com/simonsfoundation.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-awslambda-container\n\nCreate an AWS Lambda powered API endpoint using a custom build Ubuntu base image for ECR container.\n\n## Getting Started\n\nInstall [serverless framework](https://www.serverless.com/framework/docs/getting-started) via NPM or as a standalone\nbinary.\n\n```shell\n$ sls --version\nFramework Core: 3.31.0\nPlugin: 6.2.3\nSDK: 4.3.2\n```\n\nYou should also have permissions to deploy to AWS Lambda, ECR, Cloudwatch, S3, and create IAM Lambda execution role.\n\nCreate an environment file `.env` with AWS profile infomation.\n\nThe sample `.env` file below also has environment vars necessary for currect serverless.yml.\n\n```shell\nAWS_PROFILE=\"my-profile-name\"\nAWS_REGION=\"us-east-1\"\nENVIRON_VARIABLE_1=\"HelloWorld\"\nTAG_MANAGED_BY=\"email@example.com\"\nTAG_COST_CENTER=\"12345-05432\"\n```\n\n## Deploy\n\nAdd AWS credentials to `~/.aws/credentials`\n\nTo build container from dockerfile and deploy to ecr for lambda\n\n```shell\nsls deploy\n```\n\nTo remove everything created by serverless\n\n```shell\nsls remove\n```\n\nMake sure to save the `.serverless` directory as it contains JSON statefiles which are helpful for future updates.\n\n## Writing the application\n\nThe Dockerfile will copy over everything in the `app` directory and install python requirements from `requirements.txt`\n\n```dockerfile\n# Copy function code\nCOPY ./app/ ${LAMBDA_TASK_ROOT}/\n\n# Install function dependencies\nCOPY requirements.txt /\nRUN pip install \\\n    -r \"/requirements.txt\" \\\n    --target \"${LAMBDA_TASK_ROOT}\"\n```\n\nYou can add additional dependencies and build up your code within the `app` directory.\n\nLambda supports container images upto 10GB in size.\n\nBest of luck!\n\n## References\n\n[https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/](https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/)\n\n[https://docs.aws.amazon.com/lambda/latest/dg/images-create.html](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html)\n\n[https://aws.amazon.com/blogs/opensource/simplify-development-using-aws-lambda-container-image-with-a-serverless-framework/](https://aws.amazon.com/blogs/opensource/simplify-development-using-aws-lambda-container-image-with-a-serverless-framework/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsfoundation%2Fserverless-awslambda-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonsfoundation%2Fserverless-awslambda-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsfoundation%2Fserverless-awslambda-container/lists"}