appleboy / lambda-action

GitHub Action for Deploying Lambda code to an existing function
https://github.com/marketplace/actions/aws-lambda-deploy
MIT License
394 stars 58 forks source link

Deploying an image doesn't work #47

Closed thesocialproxy closed 2 years ago

thesocialproxy commented 2 years ago

I am trying to deploy an image to Lambda, but I keep getting critical errors. I think I am using the action properly, this is my .yml:

name: Deploy to Amazon Lambda

on:
  push:
    branches:
      - "master"

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    environment: production

    steps:
      - 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: eu-central-1
          function_name: test2
          handler: handler
          memory_size: 500
          timeout: 10
          role: test2-role-t8u20e4g
          image_uri: <account>.dkr.ecr.eu-central-1.amazonaws.com/<repo>:latest

However, I am getting:

Run appleboy/lambda-action@master
  with:
    aws_access_key_id: ***
    aws_secret_access_key: ***
    aws_region: eu-central-1
    function_name: test2
    handler: handler
    memory_size: 500
    timeout: 10
    role: test2-role-t8u20e4g
    image_uri: <account>.dkr.ecr.eu-central-1.amazonaws.com/<repo>:latest
    publish: true
/usr/bin/docker run --name b624cd9f55b9a884e66a6c0cefc6caac7a4_726760 --label 905b62 --workdir /github/workspace --rm -e INPUT_AWS_ACCESS_KEY_ID -e INPUT_AWS_SECRET_ACCESS_KEY -e INPUT_AWS_REGION -e INPUT_FUNCTION_NAME -e INPUT_HANDLER -e INPUT_MEMORY_SIZE -e INPUT_TIMEOUT -e INPUT_ROLE -e INPUT_IMAGE_URI -e INPUT_AWS_SESSION_TOKEN -e INPUT_AWS_PROFILE -e INPUT_S3_BUCKET -e INPUT_S3_KEY -e INPUT_S3_OBJECT_VERSION -e INPUT_ZIP_FILE -e INPUT_SOURCE -e INPUT_DRY_RUN -e INPUT_DEBUG -e INPUT_PUBLISH -e INPUT_REVERSION_ID -e INPUT_RUNTIME -e INPUT_ENVIRONMENT -e INPUT_LAYERS -e INPUT_SUBNETS -e INPUT_SECURITYGROUPS -e INPUT_DESCRIPTION -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/<repo>/<repo>":"/github/workspace" 905b62:4cd9f55b9a884e66a6c0cefc6caac7a4
2021/12/05 16:43:54 ValidationException: 
    status code: 400, request id: 6e4aee3e-fd22-4860-9309-6c9036687007
2021/12/05 16:43:54 ValidationException: 
    status code: 400, request id: 6e4aee3e-fd22-4860-9309-6c9036687007

I have already double-checked that my IAM user has full admin access (just for testing), I am not sure what is wrong.

Any suggestions?

thesocialproxy commented 2 years ago

The problem was an old version of Terraform AWS module, after updating to the latest, it works.