distributions
Creates, updates, deletes or gets a distribution
resource or lists distributions
in a region
Overview
Name | distributions |
Type | Resource |
Description | Resource Type definition for AWS::Lightsail::Distribution |
Id | aws.lightsail.distributions |
Fields
Name | Datatype | Description |
---|---|---|
distribution_name | string | The name for the distribution. |
distribution_arn | string | |
bundle_id | string | The bundle ID to use for the distribution. |
ip_address_type | string | The IP address type for the distribution. |
cache_behaviors | array | An array of objects that describe the per-path cache behavior for the distribution. |
cache_behavior_settings | object | An object that describes the cache behavior settings for the distribution. |
default_cache_behavior | object | An object that describes the default cache behavior for the distribution. |
origin | object | An object that describes the origin resource for the distribution, such as a Lightsail instance or load balancer. |
status | string | The status of the distribution. |
able_to_update_bundle | boolean | Indicates whether the bundle that is currently applied to your distribution, specified using the distributionName parameter, can be changed to another bundle. |
is_enabled | boolean | Indicates whether the distribution is enabled. |
certificate_name | string | The certificate attached to the Distribution. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | DistributionName, BundleId, DefaultCacheBehavior, Origin, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all distributions
in a region.
SELECT
region,
distribution_name,
distribution_arn,
bundle_id,
ip_address_type,
cache_behaviors,
cache_behavior_settings,
default_cache_behavior,
origin,
status,
able_to_update_bundle,
is_enabled,
certificate_name,
tags
FROM aws.lightsail.distributions
WHERE region = 'us-east-1';
Gets all properties from an individual distribution
.
SELECT
region,
distribution_name,
distribution_arn,
bundle_id,
ip_address_type,
cache_behaviors,
cache_behavior_settings,
default_cache_behavior,
origin,
status,
able_to_update_bundle,
is_enabled,
certificate_name,
tags
FROM aws.lightsail.distributions
WHERE region = 'us-east-1' AND data__Identifier = '<DistributionName>';
INSERT
example
Use the following StackQL query and manifest file to create a new distribution
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.lightsail.distributions (
DistributionName,
BundleId,
DefaultCacheBehavior,
Origin,
region
)
SELECT
'{{ DistributionName }}',
'{{ BundleId }}',
'{{ DefaultCacheBehavior }}',
'{{ Origin }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.lightsail.distributions (
DistributionName,
BundleId,
IpAddressType,
CacheBehaviors,
CacheBehaviorSettings,
DefaultCacheBehavior,
Origin,
IsEnabled,
CertificateName,
Tags,
region
)
SELECT
'{{ DistributionName }}',
'{{ BundleId }}',
'{{ IpAddressType }}',
'{{ CacheBehaviors }}',
'{{ CacheBehaviorSettings }}',
'{{ DefaultCacheBehavior }}',
'{{ Origin }}',
'{{ IsEnabled }}',
'{{ CertificateName }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: distribution
props:
- name: DistributionName
value: '{{ DistributionName }}'
- name: BundleId
value: '{{ BundleId }}'
- name: IpAddressType
value: '{{ IpAddressType }}'
- name: CacheBehaviors
value:
- Behavior: '{{ Behavior }}'
Path: '{{ Path }}'
- name: CacheBehaviorSettings
value:
AllowedHTTPMethods: '{{ AllowedHTTPMethods }}'
CachedHTTPMethods: '{{ CachedHTTPMethods }}'
DefaultTTL: '{{ DefaultTTL }}'
MaximumTTL: '{{ MaximumTTL }}'
MinimumTTL: '{{ MinimumTTL }}'
ForwardedCookies:
CookiesAllowList:
- '{{ CookiesAllowList[0] }}'
Option: '{{ Option }}'
ForwardedHeaders:
HeadersAllowList:
- '{{ HeadersAllowList[0] }}'
Option: '{{ Option }}'
ForwardedQueryStrings:
QueryStringsAllowList:
- '{{ QueryStringsAllowList[0] }}'
Option: '{{ Option }}'
- name: DefaultCacheBehavior
value:
Behavior: '{{ Behavior }}'
- name: Origin
value:
Name: '{{ Name }}'
ProtocolPolicy: '{{ ProtocolPolicy }}'
RegionName: '{{ RegionName }}'
- name: IsEnabled
value: '{{ IsEnabled }}'
- name: CertificateName
value: '{{ CertificateName }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.lightsail.distributions
WHERE data__Identifier = '<DistributionName>'
AND region = 'us-east-1';
Permissions
To operate on the distributions
resource, the following permissions are required:
Create
lightsail:AttachCertificateToDistribution,
lightsail:CreateDistribution,
lightsail:DetachCertificateFromDistribution,
lightsail:GetCertificates,
lightsail:GetCertificateDetails,
lightsail:GetDistributions,
lightsail:TagResource,
lightsail:UntagResource,
lightsail:UpdateDistribution,
lightsail:UpdateDistributionBundle
Read
lightsail:GetDistributions
Update
lightsail:AttachCertificateToDistribution,
lightsail:DetachCertificateFromDistribution,
lightsail:GetCertificates,
lightsail:GetCertificateDetails,
lightsail:GetDistributions,
lightsail:TagResource,
lightsail:UntagResource,
lightsail:UpdateDistribution,
lightsail:UpdateDistributionBundle
Delete
lightsail:DeleteDistribution,
lightsail:GetDistributions
List
lightsail:GetDistributions