Skip to content

aws.lightsail.get_distributions

Example SQL Queries

SELECT * FROM
aws.lightsail.get_distributions;

Description

Returns information about one or more of your Amazon Lightsail content delivery network (CDN) distributions.

Table Definition

Column NameColumn Data Type
distribution_name Input Column

The name of the distribution for which to return information.

When omitted, the response includes all of your distributions in the Amazon Web Services Region where the request is made.

VARCHAR
page_token Input Column

The token to advance to the next page of results from your request.

To get a page token, perform an initial GetDistributions request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
distributions

An array of objects that describe your distributions.

STRUCT(
"name" VARCHAR,
"arn" VARCHAR,
"support_code" VARCHAR,
"created_at" TIMESTAMP_S,
"location" STRUCT(
"availability_zone" VARCHAR,
"region_name" VARCHAR
),
"resource_type" VARCHAR,
"alternative_domain_names" VARCHAR[],
"status" VARCHAR,
"is_enabled" BOOLEAN,
"domain_name" VARCHAR,
"bundle_id" VARCHAR,
"certificate_name" VARCHAR,
"origin" STRUCT(
"name" VARCHAR,
"resource_type" VARCHAR,
"region_name" VARCHAR,
"protocol_policy" VARCHAR,
"response_timeout" BIGINT
),
"origin_public_dns" VARCHAR,
"default_cache_behavior" STRUCT(
"behavior" VARCHAR
),
"cache_behavior_settings" STRUCT(
"default_ttl" BIGINT,
"minimum_ttl" BIGINT,
"maximum_ttl" BIGINT,
"allowed_http_methods" VARCHAR,
"cached_http_methods" VARCHAR,
"forwarded_cookies" STRUCT(
"option" VARCHAR,
"cookies_allow_list" VARCHAR[]
),
"forwarded_headers" STRUCT(
"option" VARCHAR,
"headers_allow_list" VARCHAR[]
),
"forwarded_query_strings" STRUCT(
"option" BOOLEAN,
"query_strings_allow_list" VARCHAR[]
)
),
"cache_behaviors" STRUCT(
"path" VARCHAR,
"behavior" VARCHAR
)[],
"able_to_update_bundle" BOOLEAN,
"ip_address_type" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"viewer_minimum_tls_protocol_version" VARCHAR
)[]
Show child fields
distributions[]
Show child fields
distributions[].able_to_update_bundle

Indicates whether the bundle that is currently applied to your distribution, specified using the distributionName parameter, can be changed to another bundle.

Use the UpdateDistributionBundle action to change your distribution's bundle.

distributions[].alternative_domain_names[]
distributions[].arn

The Amazon Resource Name (ARN) of the distribution.

distributions[].bundle_id

The ID of the bundle currently applied to the distribution.

distributions[].cache_behavior_settings

An object that describes the cache behavior settings of the distribution.

Show child fields
distributions[].cache_behavior_settings.allowed_http_methods

The HTTP methods that are processed and forwarded to the distribution's origin.

You can specify the following options:

  • GET,HEAD - The distribution forwards the GET and HEAD methods.

  • GET,HEAD,OPTIONS - The distribution forwards the GET, HEAD, and OPTIONS methods.

  • GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards the GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE methods.

If you specify the third option, you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin.

distributions[].cache_behavior_settings.cached_http_methods

The HTTP method responses that are cached by your distribution.

You can specify the following options:

  • GET,HEAD - The distribution caches responses to the GET and HEAD methods.

  • GET,HEAD,OPTIONS - The distribution caches responses to the GET, HEAD, and OPTIONS methods.

distributions[].cache_behavior_settings.default_ttl

The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.

The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects.

distributions[].cache_behavior_settings.forwarded_cookies

An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.

Show child fields
distributions[].cache_behavior_settings.forwarded_cookies.cookies_allow_list[]
distributions[].cache_behavior_settings.forwarded_cookies.option

Specifies which cookies to forward to the distribution's origin for a cache behavior: all, none, or allow-list to forward only the cookies specified in the cookiesAllowList parameter.

distributions[].cache_behavior_settings.forwarded_headers

An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.

Show child fields
distributions[].cache_behavior_settings.forwarded_headers.headers_allow_list[]
distributions[].cache_behavior_settings.forwarded_headers.option

The headers that you want your distribution to forward to your origin and base caching on.

You can configure your distribution to do one of the following:

  • all - Forward all headers to your origin.

  • none - Forward only the default headers.

  • allow-list - Forward only the headers you specify using the headersAllowList parameter.

distributions[].cache_behavior_settings.forwarded_query_strings

An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded.

Show child fields
distributions[].cache_behavior_settings.forwarded_query_strings.option

Indicates whether the distribution forwards and caches based on query strings.

distributions[].cache_behavior_settings.forwarded_query_strings.query_strings_allow_list[]
distributions[].cache_behavior_settings.maximum_ttl

The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects.

distributions[].cache_behavior_settings.minimum_ttl

The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin.

distributions[].cache_behaviors[]
Show child fields
distributions[].cache_behaviors[].behavior

The cache behavior for the specified path.

You can specify one of the following per-path cache behaviors:

  • cache - This behavior caches the specified path.

  • dont-cache - This behavior doesn't cache the specified path.

distributions[].cache_behaviors[].path

The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories (path/to/assets/*), and file types (*.html, *jpg, *js). Directories and file paths are case-sensitive.

Examples:

  • Specify the following to cache all files in the document root of an Apache web server running on a Lightsail instance.

    var/www/html/

  • Specify the following file to cache only the index page in the document root of an Apache web server.

    var/www/html/index.html

  • Specify the following to cache only the .html files in the document root of an Apache web server.

    var/www/html/*.html

  • Specify the following to cache only the .jpg, .png, and .gif files in the images sub-directory of the document root of an Apache web server.

    var/www/html/images/*.jpg

    var/www/html/images/*.png

    var/www/html/images/*.gif

    Specify the following to cache all files in the images sub-directory of the document root of an Apache web server.

    var/www/html/images/

distributions[].certificate_name

The name of the SSL/TLS certificate attached to the distribution, if any.

distributions[].created_at

The timestamp when the distribution was created.

distributions[].default_cache_behavior

An object that describes the default cache behavior of the distribution.

Show child fields
distributions[].default_cache_behavior.behavior

The cache behavior of the distribution.

The following cache behaviors can be specified:

  • cache - This option is best for static sites. When specified, your distribution caches and serves your entire website as static content. This behavior is ideal for websites with static content that doesn't change depending on who views it, or for websites that don't use cookies, headers, or query strings to personalize content.

  • dont-cache - This option is best for sites that serve a mix of static and dynamic content. When specified, your distribution caches and serve only the content that is specified in the distribution's CacheBehaviorPerPath parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users.

distributions[].domain_name

The domain name of the distribution.

distributions[].ip_address_type

The IP address type of the distribution.

The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6.

distributions[].is_enabled

Indicates whether the distribution is enabled.

distributions[].location

An object that describes the location of the distribution, such as the Amazon Web Services Region and Availability Zone.

Lightsail distributions are global resources that can reference an origin in any Amazon Web Services Region, and distribute its content globally. However, all distributions are located in the us-east-1 Region.

Show child fields
distributions[].location.availability_zone

The Availability Zone. Follows the format us-east-2a (case-sensitive).

distributions[].location.region_name

The Amazon Web Services Region name.

distributions[].name

The name of the distribution.

distributions[].origin

An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.

The distribution pulls, caches, and serves content from the origin.

Show child fields
distributions[].origin.name

The name of the origin resource.

distributions[].origin.protocol_policy

The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.

distributions[].origin.region_name

The AWS Region name of the origin resource.

distributions[].origin.resource_type

The resource type of the origin resource (Instance).

distributions[].origin.response_timeout

The amount of time, in seconds, that the distribution waits for a response after forwarding a request to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

distributions[].origin_public_dns

The public DNS of the origin.

distributions[].resource_type

The Lightsail resource type (Distribution).

distributions[].status

The status of the distribution.

distributions[].support_code

The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily.

distributions[].tags[]
Show child fields
distributions[].tags[].key

The key of the tag.

Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ :/@

distributions[].tags[].value

The value of the tag.

Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ :/@

distributions[].viewer_minimum_tls_protocol_version

The minimum TLS protocol version that the distribution can use to communicate with viewers.

next_page_token

The token to advance to the next page of results from your request.

A next page token is not returned if there are no more results to display.

To get the next page of results, perform another GetDistributions request and specify the next page token using the pageToken parameter.

VARCHAR