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_configfrom aws_cloudfront_function;
select name, status, arn, e_tag, function_configfrom aws_cloudfront_function;
List details of all functions deployed to the live stage
select name, function_config ->> 'Comment' as comment, arn, status, e_tagfrom aws_cloudfront_functionwhere function_metadata ->> 'Stage' = 'LIVE';
select name, json_extract(function_config, '$.Comment') as comment, arn, status, e_tagfrom aws_cloudfront_functionwhere 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_timefrom aws_cloudfront_functionorder 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_timefrom aws_cloudfront_functionorder 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_timefrom aws_cloudfront_functionwhere (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_timefrom aws_cloudfront_functionwhere datetime( json_extract(function_metadata, '$.LastModifiedTime') ) >= datetime('now', '-1 hour')order by json_extract(function_metadata, '$.LastModifiedTime') DESC;
Schema for aws_cloudfront_function
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. | |
arn | text | The version identifier for the current version of the CloudFront function. | |
e_tag | text | The version identifier for the current version of the CloudFront function. | |
function_config | jsonb | Contains configuration information about a CloudFront function. | |
function_metadata | jsonb | Contains metadata about a CloudFront function. | |
name | text | = | The name of the CloudFront function. |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | The status of the CloudFront function. | |
title | text | Title 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