Skip to main content

Use Case for AWS Lambda Functions should not have an excessive number of old versions

  1. Configure AWS Lambda Functions should not have an excessive number of old versions
  2. Use Case for AWS Lambda Functions should not have an excessive number of old versions
  3. Triage Guides by Violation Type
    1. Triage AWS Lambda Functions should not have an excessive number of old versions EXCESS_VERSIONS

AWS Lambda Function Version Count Policy

Overview

This policy helps manage the number of versions for an AWS Lambda function. It's designed to prevent excessive versions, which can lead to increased costs and potential management difficulties.

Why Use This Policy?

Pros

  • Cost Management: Reduces potential costs associated with managing numerous Lambda function versions.
  • Simplicity: Keeps Lambda function versions manageable, making it easier to maintain and update functions.

Cons

  • Version Limitations: May limit the number of versions you can maintain, which could be an issue for complex development workflows.

How It Works

This policy checks the number of versions of a specified AWS Lambda function and flags if it exceeds a set threshold.

Policy Variables

  • threshold: (Default: 5) The maximum number of versions allowed for a Lambda function.

Violation Type IDs

  • EXCESS_VERSIONS: Triggered when the number of Lambda function versions exceeds the specified threshold.

Configuration

To configure this policy, set the threshold variable to the desired maximum number of versions for your Lambda functions. The policy will then monitor the versions and alert you if the threshold is exceeded.