Table: aws_lambda_version - Query AWS Lambda Versions using SQL
The AWS Lambda Version is a distinct AWS Lambda function configuration that includes the function code and settings. Each Lambda function version has a unique Amazon Resource Name (ARN) and is immutable once it is published. It allows you to manage, invoke, or traffic shift between different versions of a function.
Table Usage Guide
The aws_lambda_version
table in Steampipe provides you with information about each version of a specific AWS Lambda function. This table allows you, as a DevOps engineer, to query version-specific details, including function name, function ARN, runtime environment, and associated metadata. You can utilize this table to gather insights on function versions, such as code size, last modification time, version, and more. The schema outlines the various attributes of the Lambda function version for you, including the function ARN, version, description, and associated tags.
Examples
Runtime info of each lambda version
Identify instances where specific versions of Lambda functions are running to understand their operational status. This allows for efficient management and potential optimization of cloud resources.
select function_name, version, runtime, handlerfrom aws_lambda_version;
select function_name, version, runtime, handlerfrom aws_lambda_version;
List of lambda versions where code run timout is more than 2 mins
Identify instances where AWS Lambda versions have a code run timeout exceeding 2 minutes. This is useful to pinpoint potential performance issues and optimize your Lambda functions for efficient execution.
select function_name, version, timeoutfrom aws_lambda_versionwhere timeout :: int > 120;
select function_name, version, timeoutfrom aws_lambda_versionwhere cast(timeout as integer) > 120;
VPC info of each lambda version
Explore the network configurations of different versions of AWS Lambda functions. This can be used to understand how these functions are interacting with your Virtual Private Cloud (VPC) infrastructure, helping to identify potential security or connectivity issues.
select function_name, version, vpc_id, vpc_security_group_ids, vpc_subnet_idsfrom aws_lambda_version;
select function_name, version, vpc_id, vpc_security_group_ids, vpc_subnet_idsfrom aws_lambda_version;
List policy details
Gain insights into the specifics of your AWS Lambda version policies. This query is beneficial for understanding and reviewing your policy configurations in a user-friendly format.
select jsonb_pretty(policy) as policy, jsonb_pretty(policy_std) as policy_stdfrom aws_lambda_version;
select policy, policy_stdfrom aws_lambda_version;
Schema for aws_lambda_version
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
account_id | text | The AWS Account ID in which the resource is located. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The function's Amazon Resource Name (ARN). | |
code_sha_256 | text | The SHA256 hash of the function's deployment package. | |
code_size | bigint | The size of the function's deployment package, in bytes. | |
description | text | The function's description. | |
environment_variables | jsonb | The environment variables that are accessible from function code during execution. | |
function_name | text | = | The name of the function. |
handler | text | The function that Lambda calls to begin executing your function. | |
last_modified | timestamp with time zone | The date and time that the function was last updated, in ISO-8601 format. | |
last_update_status | text | The status of the last update that was performed on the function. | |
last_update_status_reason | text | The reason for the last update that was performed on the function. | |
last_update_status_reason_code | text | The reason code for the last update that was performed on the function. | |
master_arn | text | For Lambda@Edge functions, the ARN of the master function. | |
memory_size | bigint | The memory that's allocated to the function. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
policy | jsonb | Contains the resource-based policy. | |
policy_std | jsonb | Contains the contents of the resource-based policy in a canonical form for easier searching. | |
region | text | The AWS Region in which the resource is located. | |
revision_id | text | The latest updated revision of the function or alias. | |
runtime | text | The runtime environment for the Lambda function. | |
state | text | The current state of the function. | |
timeout | bigint | The amount of time in seconds that Lambda allows a function to run before stopping it. | |
title | text | Title of the resource. | |
version | text | = | The version of the Lambda function. |
vpc_id | text | The ID of the VPC. | |
vpc_security_group_ids | jsonb | A list of VPC security groups IDs attached to Lambda function. | |
vpc_subnet_ids | jsonb | A list of VPC subnet IDs attached to Lambda function. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_lambda_version