{"id":22428509,"url":"https://github.com/kwame-mintah/aws-lambda-function-template","last_synced_at":"2026-04-29T04:38:08.779Z","repository":{"id":217763542,"uuid":"743190587","full_name":"kwame-mintah/aws-lambda-function-template","owner":"kwame-mintah","description":"📄 A template for AWS lambda function as container image, so others can generate new repositories with example unit tests, dockerfile, github actions etc.","archived":false,"fork":false,"pushed_at":"2024-07-17T20:05:33.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T06:45:11.873Z","etag":null,"topics":["aws","aws-lambda","github-action","templates"],"latest_commit_sha":null,"homepage":"","language":"Python","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/kwame-mintah.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":"2024-01-14T15:53:52.000Z","updated_at":"2024-12-05T09:03:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9b20197-874b-42b5-a7e0-67ac5d86377e","html_url":"https://github.com/kwame-mintah/aws-lambda-function-template","commit_stats":null,"previous_names":["kwame-mintah/aws-lambda-function-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/kwame-mintah/aws-lambda-function-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Faws-lambda-function-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Faws-lambda-function-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Faws-lambda-function-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Faws-lambda-function-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwame-mintah","download_url":"https://codeload.github.com/kwame-mintah/aws-lambda-function-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Faws-lambda-function-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261927623,"owners_count":23231380,"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","github-action","templates"],"created_at":"2024-12-05T20:15:02.499Z","updated_at":"2026-04-29T04:38:03.745Z","avatar_url":"https://github.com/kwame-mintah.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Lambda Function Template\n\n[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3121/)\n\u003ca href=\"https://github.com/new?template_name=aws-lambda-function-template\u0026template_owner=kwame-mintah\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/use%20this-template-blue?logo=github\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n\nThis is a template project for a AWS Lambda function deployed as a docker image.\n\nThis repository is intended as a quick-start and includes the following:\n\n- A `Dockerfile` to build the lambda function\n- GitHub Actions to build and push the image to an AWS Elastic Container Registry (ECR)\n- Pre-commit hooks to run on each commit\n- Example unit and feature tests\n\n## Development\n\n### Dependencies\n\n- [Python](https://www.python.org/downloads/release/python-3121/)\n- [Docker for Desktop](https://www.docker.com/products/docker-desktop/)\n- [Amazon Web Services](https://aws.amazon.com/?nc2=h_lg)\n\n## Usage\n\n1. Build the docker image locally:\n\n   ```commandline\n   docker build --no-cache -t aws_lambda:local .\n   ```\n\n2. Run the docker image built:\n\n   ```commandline\n   docker run --platform linux/amd64 -p 9000:8080 aws_lambda:local\n   ```\n\n3. Send an event to the lambda via curl:\n   ```commandline\n   curl \"http://localhost:9000/2015-03-31/functions/function/invocations\" -d '{\u003cREPLACE_WITH_JSON_BELOW\u003e}'\n   ```\n   ```json\n   {\n     \"Records\": [\n       {\n         \"eventVersion\": \"2.0\",\n         \"eventSource\": \"aws:s3\",\n         \"awsRegion\": \"us-east-1\",\n         \"eventTime\": \"1970-01-01T00:00:00.000Z\",\n         \"eventName\": \"ObjectCreated:Put\",\n         \"userIdentity\": { \"principalId\": \"EXAMPLE\" },\n         \"requestParameters\": { \"sourceIPAddress\": \"127.0.0.1\" },\n         \"responseElements\": {\n           \"x-amz-request-id\": \"EXAMPLE123456789\",\n           \"x-amz-id-2\": \"EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH\"\n         },\n         \"s3\": {\n           \"s3SchemaVersion\": \"1.0\",\n           \"configurationId\": \"testConfigRule\",\n           \"bucket\": {\n             \"name\": \"example-bucket\",\n             \"ownerIdentity\": { \"principalId\": \"EXAMPLE\" },\n             \"arn\": \"arn:aws:s3:::example-bucket\"\n           },\n           \"object\": {\n             \"key\": \"test%2Fkey\",\n             \"size\": 1024,\n             \"eTag\": \"0123456789abcdef0123456789abcdef\",\n             \"sequencer\": \"0A1B2C3D4E5F678901\"\n           }\n         }\n       }\n     ]\n   }\n   ```\n\n## GitHub Action (CI/CD)\n\nThe GitHub Action \"🚀 Push Docker image to AWS ECR\" will checkout the repository and push a docker image to the chosen AWS ECR using\n[configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials/tree/v4.0.1/) action. The following repository secrets need to be set:\n\n| Secret             | Description                  |\n| ------------------ | ---------------------------- |\n| AWS_REGION         | The AWS Region.              |\n| AWS_ACCOUNT_ID     | The AWS account ID.          |\n| AWS_ECR_REPOSITORY | The AWS ECR repository name. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwame-mintah%2Faws-lambda-function-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwame-mintah%2Faws-lambda-function-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwame-mintah%2Faws-lambda-function-template/lists"}