steampipe plugin install aws

Table: aws_cloudfront_function - Query AWS CloudFront Functions using SQL

The AWS CloudFront Function is a feature of Amazon CloudFront that allows you to write lightweight functions in JavaScript for high-scale, latency-sensitive CDN customizations. These functions execute at the edge locations, closer to the viewer, allowing you to manipulate HTTP request and response headers, URL, and methods. This feature helps in delivering a highly personalized content with low latency to your viewers.

Table Usage Guide

The aws_cloudfront_function table in Steampipe provides you with information about functions within AWS CloudFront. This table allows you, as a DevOps engineer, to query function-specific details, including the function's ARN, stage, status, and associated metadata. You can utilize this table to gather insights on functions, such as their status, the events they are associated with, and more. The schema outlines the various attributes of the CloudFront function for you, including the function ARN, creation timestamp, last modified timestamp, and associated tags.

Examples

Basic info

select
name,
status,
arn,
e_tag,
function_config
from
aws_cloudfront_function;
select
name,
status,
arn,
e_tag,
function_config
from
aws_cloudfront_function;

List details of all functions deployed to the live stage

select
name,
function_config ->> 'Comment' as comment,
arn,
status,
e_tag
from
aws_cloudfront_function
where
function_metadata ->> 'Stage' = 'LIVE';
select
name,
json_extract(function_config, '$.Comment') as comment,
arn,
status,
e_tag
from
aws_cloudfront_function
where
json_extract(function_metadata, '$.Stage') = 'LIVE';

List functions ordered by its creation time starting with latest first

select
name,
arn,
function_metadata ->> 'Stage' as stage,
status,
function_metadata ->> 'CreatedTime' as created_time,
function_metadata ->> 'LastModifiedTime' as last_modified_time
from
aws_cloudfront_function
order by
function_metadata ->> 'CreatedTime' DESC;
select
name,
arn,
json_extract(function_metadata, '$.Stage') as stage,
status,
json_extract(function_metadata, '$.CreatedTime') as created_time,
json_extract(function_metadata, '$.LastModifiedTime') as last_modified_time
from
aws_cloudfront_function
order by
json_extract(function_metadata, '$.CreatedTime') DESC;

List functions updated in the last hour with latest first

select
name,
arn,
function_metadata ->> 'Stage' as stage,
status,
function_metadata ->> 'LastModifiedTime' as last_modified_time
from
aws_cloudfront_function
where
(function_metadata ->> 'LastModifiedTime') :: timestamp >= (now() - interval '1' hour)
order by
function_metadata ->> 'LastModifiedTime' DESC;
select
name,
arn,
json_extract(function_metadata, '$.Stage') as stage,
status,
json_extract(function_metadata, '$.LastModifiedTime') as last_modified_time
from
aws_cloudfront_function
where
datetime(
json_extract(function_metadata, '$.LastModifiedTime')
) >= datetime('now', '-1 hour')
order by
json_extract(function_metadata, '$.LastModifiedTime') DESC;

Schema for aws_cloudfront_function

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.
arntextThe version identifier for the current version of the CloudFront function.
e_tagtextThe version identifier for the current version of the CloudFront function.
function_configjsonbContains configuration information about a CloudFront function.
function_metadatajsonbContains metadata about a CloudFront function.
nametext=The name of the CloudFront function.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
regiontextThe AWS Region in which the resource is located.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statustextThe status of the CloudFront function.
titletextTitle of the resource.

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_cloudfront_function