turbot/aws_insights

Query: lambda_functions_for_api_gatewayv2_api

Usage

powerpipe query aws_insights.query.lambda_functions_for_api_gatewayv2_api

SQL

with filtered_api as (
select
api_id,
account_id,
region
from
aws_api_gatewayv2_api
where
api_id = $1
),
filtered_integration as (
select
integration_uri,
api_id,
account_id,
region
from
aws_api_gatewayv2_integration
where
api_id = $1
and account_id = (select account_id from filtered_api)
and region = (select region from filtered_api)
),
filtered_lambda_function as (
select
arn
from
aws_lambda_function
where
arn in (select integration_uri from filtered_integration)
and account_id = (select account_id from filtered_integration)
and region = (select region from filtered_integration)
)
select
f.arn as function_arn
from
filtered_integration i
join filtered_lambda_function f on i.integration_uri = f.arn
join filtered_api a on a.api_id = i.api_id;