Skip to main content

distributions

Creates, updates, deletes or gets a distribution resource or lists distributions in a region

Overview

Namedistributions
TypeResource
DescriptionA distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.
Idaws.cloudfront.distributions

Fields

NameDatatypeDescription
distribution_configobjectThe distribution's configuration.
domain_namestring
idstring
tagsarrayA complex type that contains zero or more Tag elements.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTDistributionConfig, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all distributions in a region.

SELECT
region,
distribution_config,
domain_name,
id,
tags
FROM aws.cloudfront.distributions
;

Gets all properties from an individual distribution.

SELECT
region,
distribution_config,
domain_name,
id,
tags
FROM aws.cloudfront.distributions
WHERE data__Identifier = '<Id>';

INSERT example

Use the following StackQL query and manifest file to create a new distribution resource, using stack-deploy.

/*+ create */
INSERT INTO aws.cloudfront.distributions (
DistributionConfig,
region
)
SELECT
'{{ DistributionConfig }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.cloudfront.distributions
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

To operate on the distributions resource, the following permissions are required:

Create

cloudfront:CreateDistribution,
cloudfront:CreateDistributionWithTags,
cloudfront:GetDistribution,
cloudfront:GetDistributionConfig,
cloudfront:TagResource

Delete

cloudfront:DeleteDistribution,
cloudfront:GetDistribution,
cloudfront:GetDistributionConfig

List

cloudfront:ListDistributions

Read

cloudfront:GetDistribution,
cloudfront:GetDistributionConfig

Update

cloudfront:GetDistribution,
cloudfront:GetDistributionConfig,
cloudfront:UpdateDistribution,
cloudfront:UpdateDistributionWithStagingConfig,
cloudfront:ListTagsForResource,
cloudfront:TagResource,
cloudfront:UntagResource