steampipe plugin install aws

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,
handler
from
aws_lambda_version;
select
function_name,
version,
runtime,
handler
from
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,
timeout
from
aws_lambda_version
where
timeout :: int > 120;
select
function_name,
version,
timeout
from
aws_lambda_version
where
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_ids
from
aws_lambda_version;
select
function_name,
version,
vpc_id,
vpc_security_group_ids,
vpc_subnet_ids
from
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_std
from
aws_lambda_version;
select
policy,
policy_std
from
aws_lambda_version;

Schema for aws_lambda_version

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
account_idtextThe AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe function's Amazon Resource Name (ARN).
code_sha_256textThe SHA256 hash of the function's deployment package.
code_sizebigintThe size of the function's deployment package, in bytes.
descriptiontextThe function's description.
environment_variablesjsonbThe environment variables that are accessible from function code during execution.
function_nametext=The name of the function.
handlertextThe function that Lambda calls to begin executing your function.
last_modifiedtimestamp with time zoneThe date and time that the function was last updated, in ISO-8601 format.
last_update_statustextThe status of the last update that was performed on the function.
last_update_status_reasontextThe reason for the last update that was performed on the function.
last_update_status_reason_codetextThe reason code for the last update that was performed on the function.
master_arntextFor Lambda@Edge functions, the ARN of the master function.
memory_sizebigintThe memory that's allocated to the function.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
policyjsonbContains the resource-based policy.
policy_stdjsonbContains the contents of the resource-based policy in a canonical form for easier searching.
regiontextThe AWS Region in which the resource is located.
revision_idtextThe latest updated revision of the function or alias.
runtimetextThe runtime environment for the Lambda function.
statetextThe current state of the function.
timeoutbigintThe amount of time in seconds that Lambda allows a function to run before stopping it.
titletextTitle of the resource.
versiontext=The version of the Lambda function.
vpc_idtextThe ID of the VPC.
vpc_security_group_idsjsonbA list of VPC security groups IDs attached to Lambda function.
vpc_subnet_idsjsonbA 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