githubEdit

How do I deploy a Docker Lambda with the correct image tags?

Context When deploying a Docker Lambda function using Terraform, you need to specify the correct image tags in both vars.tf and common-services.tfvars.json files. However, the image tag is only available after pushing the Docker image to Amazon ECR (Elastic Container Registry). Answer To successfully deploy a Docker Lambda with the correct image tags, follow this sequence: Build your Docker image locally Tag the Docker image with your desired version Push the tagged image to Amazon ECR Update your Terraform configuration files with the image tag: Update the image tag in vars.tf Update the image tag in common-services.tfvars.json Deploy your Lambda function using Terraform Important: You must complete the Docker image build and push process before updating the Terraform configuration files, as the image tag needs to exist in ECR for the deployment to succeed.

Last updated

Was this helpful?