Skip to main content

origin_access_controls

Creates, updates, deletes or gets an origin_access_control resource or lists origin_access_controls in a region

Overview

Nameorigin_access_controls
TypeResource
DescriptionCreates a new origin access control in CloudFront. After you create an origin access control, you can add it to an origin in a CloudFront distribution so that CloudFront sends authenticated (signed) requests to the origin.
This makes it possible to block public access to the origin, allowing viewers (users) to access the origin's content only through CloudFront.
For more information about using a CloudFront origin access control, see [Restricting access to an origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-origin.html) in the *Amazon CloudFront Developer Guide*.
Idaws.cloudfront.origin_access_controls

Fields

NameDatatypeDescription
idstring
origin_access_control_configobjectThe origin access control.
regionstringAWS region.

For more information, see AWS::CloudFront::OriginAccessControl.

Methods

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

SELECT examples

Gets all origin_access_controls in a region.

SELECT
region,
id,
origin_access_control_config
FROM aws.cloudfront.origin_access_controls
;

Gets all properties from an individual origin_access_control.

SELECT
region,
id,
origin_access_control_config
FROM aws.cloudfront.origin_access_controls
WHERE data__Identifier = '<Id>';

INSERT example

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

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

DELETE example

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

Permissions

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

Create

cloudfront:CreateOriginAccessControl

Delete

cloudfront:DeleteOriginAccessControl,
cloudfront:GetOriginAccessControl

List

cloudfront:ListOriginAccessControls

Read

cloudfront:GetOriginAccessControl

Update

cloudfront:UpdateOriginAccessControl,
cloudfront:GetOriginAccessControl