{"id":13474639,"url":"https://github.com/appleboy/lambda-action","last_synced_at":"2025-05-15T08:11:02.279Z","repository":{"id":37484483,"uuid":"187334228","full_name":"appleboy/lambda-action","owner":"appleboy","description":"GitHub Action for Deploying Lambda code  to an existing function","archived":false,"fork":false,"pushed_at":"2024-12-12T00:12:33.000Z","size":316,"stargazers_count":420,"open_issues_count":13,"forks_count":56,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-11T04:26:14.721Z","etag":null,"topics":["github","github-actions","lambda"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/aws-lambda-deploy","language":"D2","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/appleboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.paypal.me/appleboy46"]}},"created_at":"2019-05-18T08:36:42.000Z","updated_at":"2025-05-09T10:33:38.000Z","dependencies_parsed_at":"2024-01-12T04:57:17.215Z","dependency_job_id":"b39d6cb4-2b39-40d6-abe2-0d54ca91b467","html_url":"https://github.com/appleboy/lambda-action","commit_stats":{"total_commits":125,"total_committers":6,"mean_commits":"20.833333333333332","dds":"0.040000000000000036","last_synced_commit":"d4434f34826940fafd5f24545385f3b458fff7ac"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Flambda-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Flambda-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Flambda-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Flambda-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleboy","download_url":"https://codeload.github.com/appleboy/lambda-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253685217,"owners_count":21947306,"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":["github","github-actions","lambda"],"created_at":"2024-07-31T16:01:13.759Z","updated_at":"2025-05-15T08:11:02.260Z","avatar_url":"https://github.com/appleboy.png","language":"D2","readme":"# 🚀 lambda-action\n\n[GitHub Action](https://developer.github.com/actions/) for deploying Lambda code to an existing function\n\n![logo](./images/infra.svg)\n\n## Usage\n\nUpload zip file to AWS Lambda function.\n\n```yaml\nname: deploy to lambda\non: [push]\njobs:\n\n  deploy_zip:\n    name: deploy lambda function\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        go-version: [1.21]\n    steps:\n      - name: checkout source code\n        uses: actions/checkout@v3\n      - name: Install Go\n        uses: actions/setup-go@v1\n        with:\n          go-version: ${{ matrix.go-version }}\n      - name: Build binary\n        run: |\n          cd example \u0026\u0026 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -a -o main main.go \u0026\u0026 zip deployment.zip main\n      - name: default deploy\n        uses: appleboy/lambda-action@v0.2.0\n        with:\n          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws_region: ${{ secrets.AWS_REGION }}\n          function_name: gorush\n          zip_file: example/deployment.zip\n          memory_size: 128\n          timeout: 10\n          handler: foobar\n          role: arn:aws:iam::xxxxxxxxxxx:role/test1234\n          runtime: nodejs12.x\n```\n\nDeploy lambda function with source file\n\n```yaml\nname: deploy to lambda\non: [push]\njobs:\n\n  deploy_source:\n    name: deploy lambda from source\n    runs-on: ubuntu-latest\n    steps:\n      - name: checkout source code\n        uses: actions/checkout@v3\n      - name: default deploy\n        uses: appleboy/lambda-action@v0.2.0\n        with:\n          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws_region: ${{ secrets.AWS_REGION }}\n          function_name: gorush\n          source: example/index.js\n```\n\nSet dry run mode to validate the request parameters and access permissions without modifying the function code.\n\n```yaml\nname: deploy to lambda\non: [push]\njobs:\n\n  deploy:\n    name: deploy lambda function\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - name: AWS Lambda Deploy\n      uses: appleboy/lambda-action@v0.2.0\n      with:\n        aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n        aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n        aws_region: ${{ secrets.AWS_REGION }}\n        function_name: gorush\n        zip_file: output.zip\n        dry_run: true\n```\n\nDeploy from a specific branch, `master` or `release`.\n\n```yaml\nname: deploy to lambda\non: [push]\njobs:\n\n  deploy:\n    name: deploy lambda function\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - name: AWS Lambda Deploy\n      if: github.ref == 'refs/heads/master'\n      uses: appleboy/lambda-action@v0.2.0\n      with:\n        aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n        aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n        aws_region: ${{ secrets.AWS_REGION }}\n        function_name: gorush\n        zip_file: output.zip\n        dry_run: true\n```\n\nAdd multiple environment:\n\n```diff\nname: deploy to lambda\non: [push]\njobs:\n\n  deploy:\n    name: deploy lambda function\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - name: AWS Lambda Deploy\n      if: github.ref == 'refs/heads/master'\n      uses: appleboy/lambda-action@v0.2.0\n      with:\n        aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n        aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n        aws_region: ${{ secrets.AWS_REGION }}\n        function_name: gorush\n        zip_file: output.zip\n        dry_run: true\n+       environment: foo=bar,author=appleboy\n```\n\n## Input variables\n\nSee [action.yml](./action.yml) for more detailed information.\n\n* aws_region - aws region\n* aws_access_key_id - aws access key id\n* aws_secret_access_key - aws secret key\n* zip_file - file path of zip file\n* source - file list you want to zip\n* s3_bucket - An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.\n* s3_key - The Amazon S3 key of the deployment package.\n* dry_run - Set to true to validate the request parameters and access permissions without modifying the function code.\n* debug - Show debug message after upload the lambda successfully (default as `false`).\n* publish - Set to true to publish a new version of the function after updating the code. (default as `true`).\n* reversion_id - Only update the function if the revision ID matches the ID that is specified.\n* memory_size - The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.\n* timeout - The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.\n* handler - The name of the method within your code that Lambda calls to execute your function.\n* role - The function's execution role. Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+`\n* runtime - The identifier of the function's runtime. `nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2 | nodejs18.x`\n* environment - Lambda Environment variables. example: `foo=bar,author=appleboy`\n* image_uri - URI of a container image in the Amazon ECR registry.\n* subnets - Select the VPC subnets for Lambda to use to set up your VPC configuration.\n* securitygroups - Choose the VPC security groups for Lambda to use to set up your VPC configuration.\n* description - A description of the function.\n* layers - A list of function layers, to add to the function's execution environment. Specify each layer by its ARN, including the version.\n* tracing_mode - Set Mode to `Active` to sample and trace a subset of incoming requests with X-Ray.\n* max_attempts - The maximum number of times the waiter should attempt to check the resource for the target state.\n* architectures - The instruction set architecture that the function supports. `arm64 | x86_64`\n* ipv6_dual_stack - Enables or disables dual-stack IPv6 support in the VPC configuration\n\nSee the [UpdateFunctionConfiguration](https://docs.amazonaws.cn/en_us/lambda/latest/dg/API_UpdateFunctionConfiguration.html) for detail information.\n\n## AWS Policy\n\nAdd the following AWS policy if you want to integrate with GitHub Actions. Please change `REGION`, `ACCOUNT` and `LAMBDA_NAME` variable to your specfic data.\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:PutObject\",\n        \"iam:ListRoles\",\n        \"lambda:UpdateFunctionCode\",\n        \"lambda:CreateFunction\",\n        \"lambda:GetFunction\",\n        \"lambda:UpdateFunctionConfiguration\",\n        \"lambda:GetFunctionConfiguration\"\n      ],\n      \"Resource\": \"arn:aws:lambda:${REGION}:${ACCOUNT}:function:${LAMBDA_NAME}\"\n    }\n  ]\n}\n```\n\nOur function needs permission to upload trace data to [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html). When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's execution role. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role.\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"xray:PutTraceSegments\",\n        \"xray:PutTelemetryRecords\",\n        \"xray:GetSamplingRules\",\n        \"xray:GetSamplingTargets\",\n        \"xray:GetSamplingStatisticSummaries\"\n      ],\n      \"Resource\": [\n        \"*\"\n      ]\n    }\n  ]\n}\n```\n","funding_links":["https://www.paypal.me/appleboy46"],"categories":["Community Resources","D2","Uncategorized"],"sub_categories":["Deployment","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Flambda-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleboy%2Flambda-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Flambda-action/lists"}