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. | |
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. | |
architectures | jsonb | The instruction set architecture that the function supports. | |
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. | |
dead_letter_config | jsonb | The function's dead letter queue configuration. | |
description | text | The function's description. | |
environment_error | jsonb | Error messages for environment variables that couldn't be applied. | |
environment_variables | jsonb | The environment variables that are accessible from function code during execution. | |
ephemeral_storage_size | bigint | The size of the function's /tmp directory in MB. | |
file_system_configs | jsonb | Connection settings for an Amazon EFS file system. | |
function_name | text | = | The name of the function. |
handler | text | The function that Lambda calls to begin executing your function. | |
image_config_response | jsonb | The function's image configuration values. | |
kms_key_arn | text | The KMS key that's used to encrypt the function's environment variables. | |
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. | |
layers | jsonb | The function's layers. | |
logging_config | jsonb | The function's Amazon CloudWatch Logs configuration settings. | |
master_arn | text | For Lambda@Edge functions, the ARN of the master function. | |
memory_size | bigint | The memory that's allocated to the function. | |
package_type | text | The type of deployment package. Set to Image for container image and set Zip for .zip file archive. | |
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. | |
role | text | The function's execution role. | |
runtime | text | The runtime environment for the Lambda function. | |
runtime_version_config | jsonb | The ARN of the runtime and any errors that occured. | |
signing_job_arn | text | The ARN of the signing job. | |
signing_profile_version_arn | text | The ARN of the signing profile version. | |
snap_start | jsonb | Configuration for creating a snapshot of the initialized execution environment. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | The current state of the function. | |
state_reason | text | The reason for the function's current state. | |
state_reason_code | text | The reason code for the function's current state. | |
target_arn | text | The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic. | |
timeout | bigint | The amount of time in seconds that Lambda allows a function to run before stopping it. | |
title | text | Title of the resource. | |
tracing_config | jsonb | The function's X-Ray tracing configuration. | |
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