{"id":19854680,"url":"https://github.com/obytes/aws-lambda-ci","last_synced_at":"2025-07-17T06:04:13.772Z","repository":{"id":45989378,"uuid":"411192092","full_name":"obytes/aws-lambda-ci","owner":"obytes","description":"Continuous integration pipeline for AWS lambda function","archived":false,"fork":false,"pushed_at":"2024-09-26T11:18:27.000Z","size":7125,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-02T01:37:46.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/obytes.png","metadata":{"files":{"readme":"README.rst","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":"2021-09-28T08:09:04.000Z","updated_at":"2024-09-26T11:18:31.000Z","dependencies_parsed_at":"2025-05-02T01:30:46.422Z","dependency_job_id":"46a0beb0-45e1-4261-8d0c-30ad91840a6a","html_url":"https://github.com/obytes/aws-lambda-ci","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/obytes/aws-lambda-ci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obytes%2Faws-lambda-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obytes%2Faws-lambda-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obytes%2Faws-lambda-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obytes%2Faws-lambda-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obytes","download_url":"https://codeload.github.com/obytes/aws-lambda-ci/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obytes%2Faws-lambda-ci/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265571076,"owners_count":23790018,"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":"2024-11-12T14:10:07.416Z","updated_at":"2025-07-17T06:04:13.756Z","avatar_url":"https://github.com/obytes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"##################\nAWS Lambda CI\n##################\n\nContinuous integration pipeline for aws lambda function\n\n.. image:: https://github.com/obytes/aws-lambda-ci/raw/main/docs/images/demo_code_changed_deps_changed.gif\n\n*********\nFeatures\n*********\n\n✅ Supports the two famous lambda runtimes python and nodejs.\n\n✅ Supports installing custom packages that does not exist in lambda runtime passed to CI process as a\npackage's descriptor file path in git repository.\n\n✅ Supports installing custom pip/npm dependencies that does not exist in lambda runtime and passed to CI process as a\npackage's descriptor file path, `packages.json` or `requirements.txt`.\n\n✅ The integration/deployment process is fast thanks to code and dependencies caching.\n\n✅ The lambda dependencies packages are built in a sandboxed local environment that replicates the live AWS Lambda\nenvironment almost identically – including installed software and libraries.\n\n✅ The pipeline does not break the currently published version and traffic shifting between the  current and new \ndeployment is seamless.\n\n************\nRequirements\n************\n\n\nIAM Permissions\n===============\n\nThe user/role that call this pipeline should have these permissions attached to it.\n\n.. code-block:: json\n\n    {\n        \"Version\": \"2012-10-17\",\n        \"Statement\": [\n            {\n                \"Sid\": \"\",\n                \"Effect\": \"Allow\",\n                \"Action\": [\n                    \"s3:ListBucket\",\n                    \"s3:GetObject\"\n                ],\n                \"Resource\": [\n                    \"arn:aws:s3:::artifacts-bucket-name/*\",\n                    \"arn:aws:s3:::artifacts-bucket-name\"\n                ]\n            },\n            {\n                \"Sid\": \"\",\n                \"Effect\": \"Allow\",\n                \"Action\": [\n                    \"s3:PutObject\",\n                    \"s3:GetObject\"\n                ],\n                \"Resource\": [\n                    \"arn:aws:s3:::artifacts-bucket-name/lambda-ci/function-name/*\",\n                    \"arn:aws:s3:::artifacts-bucket-name/lambda-ci/function-name\"\n                ]\n            },\n            {\n                \"Sid\": \"\",\n                \"Effect\": \"Allow\",\n                \"Action\": [\n                    \"lambda:UpdateFunctionConfiguration\",\n                    \"lambda:UpdateFunctionCode\",\n                    \"lambda:UpdateAlias\",\n                    \"lambda:PublishVersion\",\n                    \"lambda:GetFunction\"\n                ],\n                \"Resource\": \"arn:aws:lambda:us-east-1:YOUR_ACCOUNT_ID:function:function-name\"\n            },\n            {\n                \"Sid\": \"\",\n                \"Effect\": \"Allow\",\n                \"Action\": [\n                    \"lambda:PublishLayerVersion\",\n                    \"Lambda:ListLayerVersions\"\n                ],\n                \"Resource\": \"arn:aws:lambda:us-east-1:YOUR_ACCOUNT_ID:layer:function-layer-name\"\n            },\n            {\n                \"Sid\": \"\",\n                \"Effect\": \"Allow\",\n                \"Action\": \"lambda:GetLayerVersion\",\n                \"Resource\": \"arn:aws:lambda:us-east-1:YOUR_ACCOUNT_ID:layer:function-layer-name:*\"\n            }\n        ]\n    }\n\nPackages\n========\n\n- ``python3``\n- ``docker``\n\n\n*****\nUsage\n*****\n\nInstallation\n============\n\n.. code-block:: bash\n\n    pip3 install aws-lambda-ci\n\n\nArguments\n=========\n\nThese are the available arguments:\n\n+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+\n|              ARG               |                                                                    USAGE                                                                   |\n+================================+============================================================================================================================================+\n| --app-s3-bucket                | The s3 bucket name that will hold the application code and dependencies                                                                    |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Required | Default: None                        | Allowed: existing S3 bucket name                                                         |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n| --function-name                | AWS lambda function name                                                                                                                   |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Required | Default: None                        | Allowed: existing lambda function name                                                   |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n| --function-runtime             | AWS lambda function runtime (eg: python3.7)                                                                                                |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Optional | Default: ``python3.8``               | Allowed: ``pythonX.x``|``nodejsX.x``                                                     |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n| --function-alias-name          | AWS Lambda alias name (eg: latest)                                                                                                         |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Optional | Default: ``latest``                  | Allowed: version tag (eg: ``latest``, ``qa``, ``prod`` ...)                              |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n| --function-layer-name          | AWS Lambda layer name (eg: demo-lambda-dependencies)                                                                                       |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Optional | Default: ``{function-name}-deps``    | Allowed: a valid layer name                                                              |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n| --app-src-path                 | Lambda function sources directory that will be archived (eg: demo-lambda/src)                                                              |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Optional | Default: current directory           | Allowed: an existing directory with source code                                          |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Packages descriptor path (eg: demo-lambda/requirements.txt)                                                                                |\n| --app-packages-descriptor-path +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Optional | Default: ``requirements.txt``        | Allowed: an existing and valid  ``requirements.txt`` or ``package.json``                 |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n| --source-version               | The unique revision id (eg: github commit sha, or SemVer tag)                                                                              |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Optional | Default: Random hash                 | Allowed: ``commit`` hash | ``tag`` ver                                                   |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n| --build-docker-repo            | Use custom build docker repository (other than lambci/lambda)                                                                              |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Optional | Default: lambci/lambda               | Allowed: a valid docker repo without image tag part                                      |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n| --build-docker-image           | Custom build docker image tag (if not provided, will use build-{[python|node][runtime-version]}) lambci/lambda repo                        |\n|                                +----------+--------------------------------------+------------------------------------------------------------------------------------------+\n|                                | Optional | Default: None                        | Allowed: an existing docker image tag                                                    |\n+--------------------------------+----------+--------------------------------------+------------------------------------------------------------------------------------------+\n\n\nExample\n========\n\n.. code-block:: bash\n\n    aws-lambda-ci \\\n    --app-s3-bucket \"kodhive-prd-useast1-ippan-core-artifacts\" \\\n    --function-name \"useast1-mimoto-api-v1-codeless\" \\\n    --function-runtime \"python3.11\" \\\n    --function-alias-name \"latest\" \\\n    --function-layer-name \"useast1-mimoto-api-v1-codeless-deps\" \\\n    --app-src-path \"app/api/src\" \\\n    --app-packages-descriptor-path \"app/api/src/requirements/lambda.txt\" \\\n    --source-version \"1.0.1\" \\\n    --aws-profile-name \"kodhive_prd\" \\\n    --watch-log-stream \\\n    --build-docker-repo public.ecr.aws/sam/build-python3.11 \\\n    --build-docker-image latest\n\nDemos\n======\n\nCode and dependencies changes\n-----------------------------\n\nIf both code and dependencies changed, the pipeline will publish both changes.\n\n.. image:: https://github.com/obytes/aws-lambda-ci/raw/main/docs/images/demo_code_changed_deps_changed.gif\n\n\nJust code changed\n-----------------\n\nIf code changed but not dependencies, the pipeline with publish new code and the dependencies will be left intact.\n\n.. image:: https://github.com/obytes/aws-lambda-ci/raw/main/docs/images/demo_just_code_changed.gif\n\n\nNothing changed\n---------------\n\nIf both code and dependencies not changed, the pipeline will not publish anything.\n\n.. image:: https://github.com/obytes/aws-lambda-ci/raw/main/docs/images/demo_nothing_changed.gif\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobytes%2Faws-lambda-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobytes%2Faws-lambda-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobytes%2Faws-lambda-ci/lists"}