├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── ci.yml │ └── goreleaser.yml ├── .goreleaser.yaml ├── Dockerfile ├── LICENSE ├── README.md ├── action.yml ├── entrypoint.sh ├── example ├── go.mod ├── go.sum └── main.go └── images ├── infra.d2 └── infra.svg /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: ['https://www.paypal.me/appleboy46'] 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: weekly 7 | - package-ecosystem: gomod 8 | directory: / 9 | schedule: 10 | interval: weekly 11 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: deploy to lambda 2 | on: [push] 3 | jobs: 4 | deploy_zip: 5 | name: deploy lambda function from zip 6 | runs-on: ubuntu-latest 7 | strategy: 8 | matrix: 9 | go-version: ["1.22"] 10 | steps: 11 | - name: checkout source code 12 | uses: actions/checkout@v4 13 | - name: Install Go 14 | uses: actions/setup-go@v5 15 | with: 16 | go-version: ${{ matrix.go-version }} 17 | - name: Build binary 18 | run: | 19 | cd example && GOOS=linux go build -v -a -o main main.go && zip deployment.zip main 20 | 21 | - name: deploy zip 22 | uses: ./ 23 | with: 24 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 25 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 26 | aws_region: ${{ secrets.AWS_REGION }} 27 | function_name: gorush 28 | runtime: nodejs20.x 29 | zip_file: example/deployment.zip 30 | 31 | - name: update env 32 | uses: ./ 33 | with: 34 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 35 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 36 | aws_region: ${{ secrets.AWS_REGION }} 37 | function_name: gorush 38 | zip_file: example/deployment.zip 39 | environment: foo=bar,author=appleboy 40 | debug: true 41 | 42 | - name: update config 43 | uses: ./ 44 | with: 45 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 46 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 47 | aws_region: ${{ secrets.AWS_REGION }} 48 | function_name: gorush 49 | zip_file: example/deployment.zip 50 | debug: true 51 | memory_size: 128 52 | timeout: 10 53 | # origin value is "hello" 54 | handler: foobar 55 | 56 | - name: dry run 57 | uses: ./ 58 | with: 59 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 60 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 61 | aws_region: ${{ secrets.AWS_REGION }} 62 | function_name: gorush 63 | zip_file: example/deployment.zip 64 | debug: true 65 | dry_run: true 66 | 67 | - name: update role 68 | uses: ./ 69 | with: 70 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 71 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 72 | aws_region: ${{ secrets.AWS_REGION }} 73 | function_name: gorush 74 | zip_file: example/deployment.zip 75 | debug: true 76 | role: arn:aws:iam::502946233425:role/service-role/gorush-role-8nb845iz 77 | dry_run: true 78 | 79 | - name: deploy description 80 | uses: ./ 81 | with: 82 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 83 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 84 | aws_region: ${{ secrets.AWS_REGION }} 85 | function_name: gorush 86 | zip_file: example/deployment.zip 87 | debug: true 88 | description: update description from github actions 89 | 90 | - name: check publish flag 91 | uses: ./ 92 | with: 93 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 94 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 95 | aws_region: ${{ secrets.AWS_REGION }} 96 | function_name: gorush 97 | zip_file: example/deployment.zip 98 | debug: true 99 | publish: false 100 | 101 | - name: check max attempts flag 102 | uses: ./ 103 | with: 104 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 105 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 106 | aws_region: ${{ secrets.AWS_REGION }} 107 | function_name: gorush 108 | zip_file: example/deployment.zip 109 | debug: true 110 | publish: false 111 | max_attempts: 200 112 | 113 | - name: deploy source code 114 | uses: ./ 115 | with: 116 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 117 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 118 | aws_region: ${{ secrets.AWS_REGION }} 119 | function_name: gorush 120 | source: example/main.go,example/go.mod,example/go.sum 121 | 122 | # Todo: update subnets and security groups 123 | # - name: update subnets and security groups 124 | # uses: ./ 125 | # with: 126 | # aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 127 | # aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 128 | # aws_region: ${{ secrets.AWS_REGION }} 129 | # function_name: gorush 130 | # source: example/main.go,example/go.mod,example/go.sum 131 | # subnets: subnet-05905c9e0ffb7e552 132 | # securitygroups: sg-0262ba785ced7600e 133 | # debug: true 134 | -------------------------------------------------------------------------------- /.github/workflows/goreleaser.yml: -------------------------------------------------------------------------------- 1 | name: Goreleaser 2 | 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | 8 | permissions: 9 | contents: write 10 | 11 | jobs: 12 | goreleaser: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | with: 18 | fetch-depth: 0 19 | 20 | - name: Setup go 21 | uses: actions/setup-go@v5 22 | with: 23 | go-version: "^1" 24 | 25 | - name: Run GoReleaser 26 | uses: goreleaser/goreleaser-action@v6 27 | with: 28 | # either 'goreleaser' (default) or 'goreleaser-pro' 29 | distribution: goreleaser 30 | version: latest 31 | args: release --clean 32 | env: 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 34 | -------------------------------------------------------------------------------- /.goreleaser.yaml: -------------------------------------------------------------------------------- 1 | builds: 2 | - # If true, skip the build. 3 | # Useful for library projects. 4 | # Default is false 5 | skip: true 6 | 7 | changelog: 8 | use: github 9 | groups: 10 | - title: Features 11 | regexp: "^.*feat[(\\w)]*:+.*$" 12 | order: 0 13 | - title: "Bug fixes" 14 | regexp: "^.*fix[(\\w)]*:+.*$" 15 | order: 1 16 | - title: "Enhancements" 17 | regexp: "^.*chore[(\\w)]*:+.*$" 18 | order: 2 19 | - title: "Refactor" 20 | regexp: "^.*refactor[(\\w)]*:+.*$" 21 | order: 3 22 | - title: "Build process updates" 23 | regexp: ^.*?(build|ci)(\(.+\))??!?:.+$ 24 | order: 4 25 | - title: "Documentation updates" 26 | regexp: ^.*?docs?(\(.+\))??!?:.+$ 27 | order: 4 28 | - title: Others 29 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/appleboy/drone-lambda:1.3.9 2 | 3 | COPY entrypoint.sh /entrypoint.sh 4 | RUN chmod +x /entrypoint.sh 5 | ENTRYPOINT ["/entrypoint.sh"] 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Bo-Yi Wu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🚀 lambda-action 2 | 3 | [GitHub Action](https://developer.github.com/actions/) for deploying Lambda code to an existing function 4 | 5 | ![logo](./images/infra.svg) 6 | 7 | ## Usage 8 | 9 | Upload zip file to AWS Lambda function. 10 | 11 | ```yaml 12 | name: deploy to lambda 13 | on: [push] 14 | jobs: 15 | 16 | deploy_zip: 17 | name: deploy lambda function 18 | runs-on: ubuntu-latest 19 | strategy: 20 | matrix: 21 | go-version: [1.21] 22 | steps: 23 | - name: checkout source code 24 | uses: actions/checkout@v3 25 | - name: Install Go 26 | uses: actions/setup-go@v1 27 | with: 28 | go-version: ${{ matrix.go-version }} 29 | - name: Build binary 30 | run: | 31 | cd example && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -a -o main main.go && zip deployment.zip main 32 | - name: default deploy 33 | uses: appleboy/lambda-action@v0.2.0 34 | with: 35 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 36 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 37 | aws_region: ${{ secrets.AWS_REGION }} 38 | function_name: gorush 39 | zip_file: example/deployment.zip 40 | memory_size: 128 41 | timeout: 10 42 | handler: foobar 43 | role: arn:aws:iam::xxxxxxxxxxx:role/test1234 44 | runtime: nodejs12.x 45 | ``` 46 | 47 | Deploy lambda function with source file 48 | 49 | ```yaml 50 | name: deploy to lambda 51 | on: [push] 52 | jobs: 53 | 54 | deploy_source: 55 | name: deploy lambda from source 56 | runs-on: ubuntu-latest 57 | steps: 58 | - name: checkout source code 59 | uses: actions/checkout@v3 60 | - name: default deploy 61 | uses: appleboy/lambda-action@v0.2.0 62 | with: 63 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 64 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 65 | aws_region: ${{ secrets.AWS_REGION }} 66 | function_name: gorush 67 | source: example/index.js 68 | ``` 69 | 70 | Set dry run mode to validate the request parameters and access permissions without modifying the function code. 71 | 72 | ```yaml 73 | name: deploy to lambda 74 | on: [push] 75 | jobs: 76 | 77 | deploy: 78 | name: deploy lambda function 79 | runs-on: ubuntu-latest 80 | steps: 81 | - uses: actions/checkout@v3 82 | - name: AWS Lambda Deploy 83 | uses: appleboy/lambda-action@v0.2.0 84 | with: 85 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 86 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 87 | aws_region: ${{ secrets.AWS_REGION }} 88 | function_name: gorush 89 | zip_file: output.zip 90 | dry_run: true 91 | ``` 92 | 93 | Deploy from a specific branch, `master` or `release`. 94 | 95 | ```yaml 96 | name: deploy to lambda 97 | on: [push] 98 | jobs: 99 | 100 | deploy: 101 | name: deploy lambda function 102 | runs-on: ubuntu-latest 103 | steps: 104 | - uses: actions/checkout@v3 105 | - name: AWS Lambda Deploy 106 | if: github.ref == 'refs/heads/master' 107 | uses: appleboy/lambda-action@v0.2.0 108 | with: 109 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 110 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 111 | aws_region: ${{ secrets.AWS_REGION }} 112 | function_name: gorush 113 | zip_file: output.zip 114 | dry_run: true 115 | ``` 116 | 117 | Add multiple environment: 118 | 119 | ```diff 120 | name: deploy to lambda 121 | on: [push] 122 | jobs: 123 | 124 | deploy: 125 | name: deploy lambda function 126 | runs-on: ubuntu-latest 127 | steps: 128 | - uses: actions/checkout@v3 129 | - name: AWS Lambda Deploy 130 | if: github.ref == 'refs/heads/master' 131 | uses: appleboy/lambda-action@v0.2.0 132 | with: 133 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 134 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 135 | aws_region: ${{ secrets.AWS_REGION }} 136 | function_name: gorush 137 | zip_file: output.zip 138 | dry_run: true 139 | + environment: foo=bar,author=appleboy 140 | ``` 141 | 142 | ## Input variables 143 | 144 | See [action.yml](./action.yml) for more detailed information. 145 | 146 | * aws_region - aws region 147 | * aws_access_key_id - aws access key id 148 | * aws_secret_access_key - aws secret key 149 | * zip_file - file path of zip file 150 | * source - file list you want to zip 151 | * s3_bucket - An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account. 152 | * s3_key - The Amazon S3 key of the deployment package. 153 | * dry_run - Set to true to validate the request parameters and access permissions without modifying the function code. 154 | * debug - Show debug message after upload the lambda successfully (default as `false`). 155 | * publish - Set to true to publish a new version of the function after updating the code. (default as `true`). 156 | * reversion_id - Only update the function if the revision ID matches the ID that is specified. 157 | * 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. 158 | * 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. 159 | * handler - The name of the method within your code that Lambda calls to execute your function. 160 | * role - The function's execution role. Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` 161 | * 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` 162 | * environment - Lambda Environment variables. example: `foo=bar,author=appleboy` 163 | * image_uri - URI of a container image in the Amazon ECR registry. 164 | * subnets - Select the VPC subnets for Lambda to use to set up your VPC configuration. 165 | * securitygroups - Choose the VPC security groups for Lambda to use to set up your VPC configuration. 166 | * description - A description of the function. 167 | * layers - A list of function layers, to add to the function's execution environment. Specify each layer by its ARN, including the version. 168 | * tracing_mode - Set Mode to `Active` to sample and trace a subset of incoming requests with X-Ray. 169 | * max_attempts - The maximum number of times the waiter should attempt to check the resource for the target state. 170 | * architectures - The instruction set architecture that the function supports. `arm64 | x86_64` 171 | * ipv6_dual_stack - Enables or disables dual-stack IPv6 support in the VPC configuration 172 | 173 | See the [UpdateFunctionConfiguration](https://docs.amazonaws.cn/en_us/lambda/latest/dg/API_UpdateFunctionConfiguration.html) for detail information. 174 | 175 | ## AWS Policy 176 | 177 | Add the following AWS policy if you want to integrate with GitHub Actions. Please change `REGION`, `ACCOUNT` and `LAMBDA_NAME` variable to your specfic data. 178 | 179 | ```json 180 | { 181 | "Version": "2012-10-17", 182 | "Statement": [ 183 | { 184 | "Effect": "Allow", 185 | "Action": [ 186 | "s3:PutObject", 187 | "iam:ListRoles", 188 | "lambda:UpdateFunctionCode", 189 | "lambda:CreateFunction", 190 | "lambda:GetFunction", 191 | "lambda:UpdateFunctionConfiguration", 192 | "lambda:GetFunctionConfiguration" 193 | ], 194 | "Resource": "arn:aws:lambda:${REGION}:${ACCOUNT}:function:${LAMBDA_NAME}" 195 | } 196 | ] 197 | } 198 | ``` 199 | 200 | Our 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. 201 | 202 | ```json 203 | { 204 | "Version": "2012-10-17", 205 | "Statement": [ 206 | { 207 | "Effect": "Allow", 208 | "Action": [ 209 | "xray:PutTraceSegments", 210 | "xray:PutTelemetryRecords", 211 | "xray:GetSamplingRules", 212 | "xray:GetSamplingTargets", 213 | "xray:GetSamplingStatisticSummaries" 214 | ], 215 | "Resource": [ 216 | "*" 217 | ] 218 | } 219 | ] 220 | } 221 | ``` 222 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "AWS Lambda Deploy" 2 | description: "Deploying Lambda code to an existing function" 3 | author: "Bo-Yi Wu" 4 | inputs: 5 | aws_region: 6 | description: "AWS Region" 7 | default: "us-east-1" 8 | aws_access_key_id: 9 | description: "AWS ACCESS KEY" 10 | aws_secret_access_key: 11 | description: "AWS SECRET KEY" 12 | aws_session_token: 13 | description: "AWS Session token" 14 | aws_profile: 15 | description: "AWS profile" 16 | function_name: 17 | description: "AWS lambda function name" 18 | s3_bucket: 19 | description: "An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account." 20 | s3_key: 21 | description: "The Amazon S3 key of the deployment package." 22 | s3_object_version: 23 | description: "AWS lambda s3 object version" 24 | zip_file: 25 | description: "AWS lambda zip file" 26 | source: 27 | description: "zip file list" 28 | dry_run: 29 | description: "Set to true to validate the request parameters and access permissions without modifying the function code." 30 | debug: 31 | description: "Show debug message after upload the lambda successfully." 32 | publish: 33 | description: "Set to true to publish a new version of the function after updating the code." 34 | default: true 35 | reversion_id: 36 | description: "Only update the function if the revision ID matches the ID that is specified." 37 | memory_size: 38 | description: "The amount of memory that your function has access to. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB." 39 | default: 0 40 | timeout: 41 | description: "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." 42 | default: 0 43 | handler: 44 | description: "The name of the method within your code that Lambda calls to execute your function." 45 | role: 46 | description: "The Amazon Resource Name (ARN) of the function execution role." 47 | runtime: 48 | description: "The identifier of the function runtime." 49 | environment: 50 | description: "Lambda Environment variables." 51 | layers: 52 | description: "A list of function layers, to add to the function execution environment. Specify each layer by its ARN, including the version" 53 | image_uri: 54 | description: "URI of a container image in the Amazon ECR registry." 55 | subnets: 56 | description: "Select the VPC subnets for Lambda to use to set up your VPC configuration." 57 | securitygroups: 58 | description: "Choose the VPC security groups for Lambda to use to set up your VPC configuration." 59 | description: 60 | description: "A description of the function." 61 | tracing_mode: 62 | description: "Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray." 63 | max_attempts: 64 | description: "the maximum number of times the waiter should attempt to check the resource for the target state" 65 | default: 600 66 | architectures: 67 | description: "The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is x86_64." 68 | ipv6_dual_stack: 69 | description: "Enables or disables dual-stack IPv6 support in the VPC configuration" 70 | 71 | runs: 72 | using: "docker" 73 | image: "Dockerfile" 74 | 75 | branding: 76 | icon: "layers" 77 | color: "gray-dark" 78 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | sh -c "/bin/drone-lambda $*" 6 | -------------------------------------------------------------------------------- /example/go.mod: -------------------------------------------------------------------------------- 1 | module lambda 2 | 3 | go 1.21 4 | 5 | require ( 6 | github.com/apex/gateway v1.1.2 7 | github.com/gin-gonic/gin v1.10.0 8 | ) 9 | 10 | require ( 11 | github.com/aws/aws-lambda-go v1.47.0 // indirect 12 | github.com/bytedance/sonic v1.11.9 // indirect 13 | github.com/bytedance/sonic/loader v0.1.1 // indirect 14 | github.com/cloudwego/base64x v0.1.4 // indirect 15 | github.com/cloudwego/iasm v0.2.0 // indirect 16 | github.com/gabriel-vasile/mimetype v1.4.4 // indirect 17 | github.com/gin-contrib/sse v0.1.0 // indirect 18 | github.com/go-playground/locales v0.14.1 // indirect 19 | github.com/go-playground/universal-translator v0.18.1 // indirect 20 | github.com/go-playground/validator/v10 v10.22.0 // indirect 21 | github.com/goccy/go-json v0.10.3 // indirect 22 | github.com/json-iterator/go v1.1.12 // indirect 23 | github.com/klauspost/cpuid/v2 v2.2.8 // indirect 24 | github.com/leodido/go-urn v1.4.0 // indirect 25 | github.com/mattn/go-isatty v0.0.20 // indirect 26 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 27 | github.com/modern-go/reflect2 v1.0.2 // indirect 28 | github.com/pelletier/go-toml/v2 v2.2.2 // indirect 29 | github.com/pkg/errors v0.9.1 // indirect 30 | github.com/twitchyliquid64/golang-asm v0.15.1 // indirect 31 | github.com/ugorji/go/codec v1.2.12 // indirect 32 | golang.org/x/arch v0.8.0 // indirect 33 | golang.org/x/crypto v0.24.0 // indirect 34 | golang.org/x/net v0.26.0 // indirect 35 | golang.org/x/sys v0.21.0 // indirect 36 | golang.org/x/text v0.16.0 // indirect 37 | google.golang.org/protobuf v1.34.2 // indirect 38 | gopkg.in/yaml.v3 v3.0.1 // indirect 39 | ) 40 | -------------------------------------------------------------------------------- /example/go.sum: -------------------------------------------------------------------------------- 1 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 2 | github.com/apex/gateway v1.1.2 h1:OWyLov8eaau8YhkYKkRuOAYqiUhpBJalBR1o+3FzX+8= 3 | github.com/apex/gateway v1.1.2/go.mod h1:AMTkVbz5u5Hvd6QOGhhg0JUrNgCcLVu3XNJOGntdoB4= 4 | github.com/aws/aws-lambda-go v1.17.0/go.mod h1:FEwgPLE6+8wcGBTe5cJN3JWurd1Ztm9zN4jsXsjzKKw= 5 | github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI= 6 | github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A= 7 | github.com/bytedance/sonic v1.11.9 h1:LFHENlIY/SLzDWverzdOvgMztTxcfcF+cqNsz9pK5zg= 8 | github.com/bytedance/sonic v1.11.9/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= 9 | github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= 10 | github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= 11 | github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= 12 | github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= 13 | github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= 14 | github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= 15 | github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 16 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 17 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 18 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 19 | github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I= 20 | github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s= 21 | github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= 22 | github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= 23 | github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= 24 | github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= 25 | github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= 26 | github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= 27 | github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= 28 | github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= 29 | github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= 30 | github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= 31 | github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao= 32 | github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= 33 | github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= 34 | github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= 35 | github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= 36 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 37 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 38 | github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= 39 | github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 40 | github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= 41 | github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= 42 | github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= 43 | github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= 44 | github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= 45 | github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= 46 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 47 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 48 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 49 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 50 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 51 | github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= 52 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 53 | github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= 54 | github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= 55 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 56 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 57 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 58 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 59 | github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 60 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 61 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 62 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 63 | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 64 | github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= 65 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 66 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 67 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 68 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 69 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 70 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 71 | github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 72 | github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 73 | github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= 74 | github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 75 | github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk= 76 | github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk= 77 | github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= 78 | github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= 79 | github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= 80 | github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= 81 | github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= 82 | golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= 83 | golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= 84 | golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= 85 | golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= 86 | golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= 87 | golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= 88 | golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= 89 | golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 90 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 91 | golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= 92 | golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 93 | golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= 94 | golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= 95 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= 96 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 97 | google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= 98 | google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 99 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 100 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 101 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 102 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 103 | gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 104 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 105 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 106 | nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= 107 | rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= 108 | -------------------------------------------------------------------------------- /example/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | "os" 7 | 8 | "github.com/apex/gateway" 9 | "github.com/gin-gonic/gin" 10 | ) 11 | 12 | func helloHandler(c *gin.Context) { 13 | name := c.Param("name") 14 | log.Println("=======================================") 15 | log.Println("name: " + name) 16 | log.Println("=======================================") 17 | c.String(http.StatusOK, "Hello %s, welcome to Gin API", name) 18 | } 19 | 20 | func welcomeHandler(c *gin.Context) { 21 | c.String(http.StatusOK, "Hello World from Golang") 22 | } 23 | 24 | func rootHandler(c *gin.Context) { 25 | c.JSON(http.StatusOK, gin.H{ 26 | "text": "Welcome to gin lambda server.", 27 | }) 28 | } 29 | 30 | func routerEngine() *gin.Engine { 31 | // set server mode 32 | gin.SetMode(gin.DebugMode) 33 | 34 | r := gin.New() 35 | 36 | // Global middleware 37 | r.Use(gin.Logger()) 38 | r.Use(gin.Recovery()) 39 | 40 | r.GET("/welcome", welcomeHandler) 41 | r.GET("/user/:name", helloHandler) 42 | r.GET("/", rootHandler) 43 | 44 | return r 45 | } 46 | 47 | func main() { 48 | port := os.Getenv("PORT") 49 | mode := os.Getenv("MODE") 50 | if port == "" { 51 | port = "8080" 52 | } 53 | addr := ":" + port 54 | log.Println("=======================================") 55 | log.Println("Running gin-lambda server in " + addr) 56 | log.Println("=======================================") 57 | if mode == "production" { 58 | log.Fatal(gateway.ListenAndServe(addr, routerEngine())) 59 | } else { 60 | log.Fatal(http.ListenAndServe(addr, routerEngine())) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /images/infra.d2: -------------------------------------------------------------------------------- 1 | direction: right 2 | 3 | github: GitHub { 4 | shape: image 5 | icon: https://icons.terrastruct.com/dev%2Fgithub.svg 6 | style: { 7 | font-color: green 8 | font-size: 30 9 | } 10 | } 11 | 12 | github_actions: GitHub Actions { 13 | lambda_action: Lambda Action { 14 | icon: https://icons.terrastruct.com/dev%2Fgithub.svg 15 | style.multiple: true 16 | } 17 | style: { 18 | stroke: blue 19 | font-color: purple 20 | stroke-dash: 3 21 | fill: white 22 | } 23 | } 24 | 25 | aws: AWS Cloud VPC { 26 | style: { 27 | font-color: purple 28 | fill: white 29 | opacity: 0.5 30 | } 31 | lambda01: Lambda01 { 32 | icon: https://icons.terrastruct.com/aws%2FCompute%2FAWS-Lambda.svg 33 | shape: parallelogram 34 | style.fill: "#B6DDF6" 35 | } 36 | lambda02: Lambda02 { 37 | icon: https://icons.terrastruct.com/aws%2FCompute%2FAWS-Lambda.svg 38 | shape: parallelogram 39 | style.fill: "#B6DDF6" 40 | } 41 | lambda03: Lambda03 { 42 | icon: https://icons.terrastruct.com/aws%2FCompute%2FAWS-Lambda.svg 43 | shape: parallelogram 44 | style.fill: "#B6DDF6" 45 | } 46 | } 47 | 48 | github -> github_actions: GitHub Action Flow { 49 | style: { 50 | animated: true 51 | font-size: 20 52 | } 53 | } 54 | github_actions -> aws.lambda01: Update Lambda { 55 | style: { 56 | animated: true 57 | font-size: 20 58 | } 59 | } 60 | github_actions -> aws.lambda02: Update Lambda { 61 | style: { 62 | animated: true 63 | font-size: 20 64 | } 65 | } 66 | github_actions -> aws.lambda03: Update Lambda { 67 | style: { 68 | animated: true 69 | font-size: 20 70 | } 71 | } 72 | 73 | explanation: |md 74 | ```yaml 75 | deploy_source: 76 | name: deploy lambda from source 77 | runs-on: ubuntu-latest 78 | steps: 79 | - name: checkout source code 80 | uses: actions/checkout@v3 81 | - name: default deploy 82 | uses: appleboy/lambda-action@v0.1.7 83 | with: 84 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} 85 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 86 | aws_region: ${{ secrets.AWS_REGION }} 87 | function_name: gorush 88 | source: example/index.js 89 | ``` 90 | | {near: bottom-center} 91 | -------------------------------------------------------------------------------- /images/infra.svg: -------------------------------------------------------------------------------- 1 | GitHubGitHub ActionsAWS Cloud VPC
deploy_source:
862 |   name: deploy lambda from source
863 |   runs-on: ubuntu-latest
864 |   steps:
865 |     - name: checkout source code
866 |       uses: actions/checkout@v3
867 |     - name: default deploy
868 |       uses: appleboy/lambda-action@v0.1.7
869 |       with:
870 |         aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
871 |         aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
872 |         aws_region: ${{ secrets.AWS_REGION }}
873 |         function_name: gorush
874 |         source: example/index.js
875 | 
876 |
Lambda ActionLambda01Lambda02Lambda03 GitHub Action FlowUpdate LambdaUpdate LambdaUpdate Lambda 877 | 878 | 879 | 880 | 881 | 882 |
883 | --------------------------------------------------------------------------------