Lambda Deploy with Github Actions - deploy succeeds but pipeline fails

Viewed 234

I am trying to deploy a Lambda function with the GO runtime. The AWS console indicates that the function was indeed updated when the pipeline runs (the Last Modified date is updated in the Lambda console), but Github Actions indicates a failure (this following error is shown twice):

2022/04/04 00:08:30 ResourceConflictException: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:us-east-2:***:function:get_all_products_go
{
  RespMetadata: {
    StatusCode: 409,
    RequestID: "cd2b5f3f-c245-4c55-9440-9bdc078bb2b9"
  },
  Message_: "The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:us-east-2:***:function:get_all_products_go",
  Type: "User"
}

Here is my pipeline configuration yaml file:

name: Deploy Lambda function

on:
  push:
    branches:
      - main

jobs:
  deploy-lambda:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1

      - name: Install Go
        uses: actions/setup-go@v2
        with:
          go-version: '1.17.4'

      - name: Install dependencies
        run: |
          go version
          go mod init storefront-lambdas
          go mod tidy

      - name: Build binary
        run: |
          GOOS=linux GOARCH=amd64 go build get-all-products.go && zip deployment.zip get-all-products

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-east-2

      - name: default deploy
        uses: appleboy/lambda-action@master
        with:
          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws_region: us-east-2
          function_name: get_all_products_go
          zip_file: deployment.zip
          memory_size: 128
          timeout: 10
          handler: get-all-products
          role: arn:aws:iam::xxxxxxxxxx:role/lambda-basic-execution
          runtime: go1.x
0 Answers
Related