Table: aws_cloudfront_origin_request_policy - Query AWS CloudFront Origin Request Policies using SQL
The AWS CloudFront Origin Request Policy is a feature of Amazon CloudFront, a content delivery network service. It allows you to control how much information about the viewer's request is forwarded to the origin. This includes headers, cookies, and URL query strings, enabling you to customize the content returned by your origin based on the values in the request.
Table Usage Guide
The aws_cloudfront_origin_request_policy
table in Steampipe provides you with information about Origin Request Policies within AWS CloudFront. This table allows you, as a DevOps engineer, to query policy-specific details, including ID, name, comment, cookies configuration, headers configuration, query strings configuration, and more. You can utilize this table to gather insights on policies, such as policy configurations and associated metadata. The schema outlines the various attributes of the Origin Request Policy for you, including the policy ID, creation date, last modified date, and associated tags.
Examples
Basic info
Explore which AWS Cloudfront origin request policies have been modified recently, gaining insights into potential changes and updates. This can be useful for maintaining security compliance and ensuring correct configuration.
select name, id, comment, etag, last_modified_timefrom aws_cloudfront_origin_request_policy;
select name, id, comment, etag, last_modified_timefrom aws_cloudfront_origin_request_policy;
Get details of HTTP headers associated with each origin request policy
Determine the characteristics of HTTP headers related to each origin request policy. This can be useful to understand how your CloudFront distributions are configured, which can help in optimizing your web content delivery and troubleshooting issues.
select name, id, headers_config ->> 'HeaderBehavior' as header_behavior, headers_config ->> 'Headers' as headersfrom aws_cloudfront_origin_request_policy;
select name, id, json_extract(headers_config, '$.HeaderBehavior') as header_behavior, json_extract(headers_config, '$.Headers') as headersfrom aws_cloudfront_origin_request_policy;
Schema for aws_cloudfront_origin_request_policy
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. | |
comment | text | The comment for this origin request policy. | |
cookies_config | jsonb | The cookies from viewer requests to include in origin requests. | |
etag | text | The current version of the origin request policy. | |
headers_config | jsonb | The HTTP headers to include in origin requests. | |
id | text | = | The ID for the origin request policy. |
last_modified_time | timestamp with time zone | The date and time when the origin request policy was last modified. | |
name | text | A unique name to identify the origin request policy. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
query_strings_config | jsonb | The URL query strings from viewer requests to include in origin requests. | |
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. | |
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_origin_request_policy