DevOps Pro

Best AWS, DevOps, Serverless, and more from top Medium writers.

Follow publication

Member-only story

Terraform — Deploying Docker Images on AWS Lambda Function

Prashant Bhatasana
DevOps Pro
Published in
4 min readSep 23, 2024

Serverless computing has revolutionized the way we develop and deploy applications. AWS Lambda, one of the leading serverless computing platforms, allows you to run code without provisioning or managing servers. While AWS Lambda supports several programming languages, sometimes you might want to use a custom runtime or even deploy applications packaged as Docker containers. In this blog post, we’ll explore how to deploy Docker images on AWS Lambda functions using Terraform.

Prerequisites

Before you begin, make sure you have the following prerequisites:

  1. An AWS account with the necessary permissions.
  2. Terraform should be installed on the machine. If Terraform does not exist you can download and install it from here.
  3. Docker: Install Docker on your local machine.

Write Application Code/Docker File

Now, let’s create a sample Application with a Docker image file

Create application folder on the root of your project directory, for sample application code.

  1. Create a file named Dockerfile with the following code:
FROM public.ecr.aws/lambda/nodejs:16

# Copy function code
COPY app.js…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

DevOps Pro
DevOps Pro

Published in DevOps Pro

Best AWS, DevOps, Serverless, and more from top Medium writers.

Prashant Bhatasana
Prashant Bhatasana

Written by Prashant Bhatasana

AWS Community Builder | AWS Certified | Terraform Associate | SR. DevOps Engineer, Love to work with #AWS #GCP #Terraform #Jenkins #Kubernetes #Docker #Ansible

No responses yet

Write a response