DEV Community

GargeeBhatnagar for AWS Community Builders

Posted on

Explore of Lambda Versions Deletion Using Lambda Function

“ I have checked the documents of AWS to delete the lambda function versions in one run instead of manually deleting each version of a function. Got a solution to delete the lambda versions using lambda function by code run. In terms of cost, the solution is cheaper and secure.”

Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. With Lambda, you can run code for virtually any type of application or backend service.

In this post, you will experience the lambda versions deletion using lambda function. Here I have created a lambda function with versions and IAM role with required permissions.

Prerequisites

You’ll need an AWS Lambda for this post. Getting started with aws Lambda provides instructions on how to create a lambda function. For this blog, I assume that I have a lambda function and IAM role created.

Architecture Overview

Image description
The architecture diagram shows the overall deployment architecture with data flow, lambda and iam role.

Solution overview

The blog post consists of the following phases:

  1. Create of Lambda Function for Deleting the Lambda Version
  2. Testing of Lambda Version Deletion

I have a lambda function with versions and IAM role with required permission created as below →
Image description
Image description
Image description
Image description
Image description

Phase 1: Create of Lambda Function for Deleting the Lambda Version

  1. Open the console for AWS lambda and create a lambda function as delete-lambda-version with function code.

Image description

Image description

Image description

Image description

Image description

Phase 2: Testing of Lambda Version Deletion

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Clean-up

Delete of IAM, lambda and cloudwatch log group.

Pricing

I review the pricing and estimated cost of this example.

Cost of Cloudwatch = $0.0

Cost of Lambda = $0.0

Total Cost = $(0.0 + 0.0) = $0.0

Summary

In this post, I showed “explore of lambda versions deletion using lambda function”.

For more details on AWS Lambda, Checkout Get started AWS Lambda, open the AWS Lambda console. To learn more, read the AWS Lambda documentation.

Thanks for reading!

Connect with me: Linkedin
Image description

Top comments (1)

Collapse
 
hectorfernandezdev profile image
Hector Fernandez CloudparaTodo

How we can access to the example code? Great post btw