Table: aws_lambda_alias - Query AWS Lambda Alias using SQL
The AWS Lambda Alias is a feature of AWS Lambda service that provides a pointer to a specific Lambda function version. It enables you to manage your function versions and routing configurations, and also allows you to shift incoming traffic between two versions of a function based on preassigned weights. This allows for a gradual code rollout and testing of new function versions in a production environment.
Table Usage Guide
The aws_lambda_alias
table in Steampipe provides you with information about alias resources within AWS Lambda. This table allows you, as a DevOps engineer, to query alias-specific details, including the associated function name, function version, and alias ARN. You can utilize this table to gather insights on aliases, such as the alias description, routing configuration, and revision ID. The schema outlines the various attributes of the Lambda alias for you, including the name, ARN, function version, and associated routing configuration.
Examples
Lambda alias basic info
Analyze the settings to understand the basic information of AWS Lambda aliases such as their names, associated function names, and function versions. This can be used to manage and track different versions of your Lambda functions.
select name, function_name, function_versionfrom aws_lambda_alias;
select name, function_name, function_versionfrom aws_lambda_alias;
Count of lambda alias per Lambda function
Determine the areas in which each AWS Lambda function is being used by counting the number of aliases associated with each function. This can help optimize resource usage and manage function versions effectively.
select function_name, count(function_name) countfrom aws_lambda_aliasgroup by function_name;
select function_name, count(function_name) as countfrom aws_lambda_aliasgroup by function_name;
List policy details
Explore the specifics of policies associated with AWS Lambda aliases. This is useful for understanding the permissions and configurations of your Lambda functions.
select jsonb_pretty(policy) as policy, jsonb_pretty(policy_std) as policy_stdfrom aws_lambda_alias;
select policy, policy_stdfrom aws_lambda_alias;
List URL configuration details for each alias
This query is useful for examining the URL configurations linked to each alias in your AWS Lambda service. It allows you to understand and manage how your functions are accessed, enhancing your ability to control and optimize your serverless applications.
select name, function_name, jsonb_pretty(url_config) as url_configfrom aws_lambda_alias;
select name, function_name, url_configfrom aws_lambda_alias;
Schema for aws_lambda_alias
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. | |
alias_arn | text | The Amazon Resource Name (ARN) of the alias. | |
description | text | A description of the alias. | |
function_name | text | = | The name of the function. |
function_version | text | = | The function version that the alias invokes. |
name | text | = | The name of the alias. |
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 | A unique identifier that changes when you update the alias. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
title | text | Title of the resource. | |
url_config | jsonb | The function URL configuration details of the alias. |
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_alias