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.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
architecturesjsonbThe instruction set architecture that the function supports.
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.
dead_letter_configjsonbThe function's dead letter queue configuration.
descriptiontextThe function's description.
environment_errorjsonbError messages for environment variables that couldn't be applied.
environment_variablesjsonbThe environment variables that are accessible from function code during execution.
ephemeral_storage_sizebigintThe size of the function's /tmp directory in MB.
file_system_configsjsonbConnection settings for an Amazon EFS file system.
function_nametext=The name of the function.
handlertextThe function that Lambda calls to begin executing your function.
image_config_responsejsonbThe function's image configuration values.
kms_key_arntextThe KMS key that's used to encrypt the function's environment variables.
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.
layersjsonbThe function's layers.
logging_configjsonbThe function's Amazon CloudWatch Logs configuration settings.
master_arntextFor Lambda@Edge functions, the ARN of the master function.
memory_sizebigintThe memory that's allocated to the function.
package_typetextThe type of deployment package. Set to Image for container image and set Zip for .zip file archive.
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.
roletextThe function's execution role.
runtimetextThe runtime environment for the Lambda function.
runtime_version_configjsonbThe ARN of the runtime and any errors that occured.
signing_job_arntextThe ARN of the signing job.
signing_profile_version_arntextThe ARN of the signing profile version.
snap_startjsonbConfiguration for creating a snapshot of the initialized execution environment.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statetextThe current state of the function.
state_reasontextThe reason for the function's current state.
state_reason_codetextThe reason code for the function's current state.
target_arntextThe Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
timeoutbigintThe amount of time in seconds that Lambda allows a function to run before stopping it.
titletextTitle of the resource.
tracing_configjsonbThe function's X-Ray tracing configuration.
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