Skip to main content

cloud_front_origin_access_identities

Creates, updates, deletes, gets or lists a cloud_front_origin_access_identities resource.

Overview

Namecloud_front_origin_access_identities
TypeResource
Idaws.cloudfront.cloud_front_origin_access_identities

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
cloud_front_origin_access_identity_configstringThe current configuration information for the identity.
idstringThe ID for the origin access identity, for example, E74FTE3AJFJ256A.
s3_canonical_user_idstringThe Amazon S3 canonical user ID for the origin access identity, used when giving the origin access identity read permission to an object in Amazon S3.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_cloud_front_origin_access_identityselectid, regionGet the information about an origin access identity.
list_cloud_front_origin_access_identitiesselectregionMarker, MaxItemsLists origin access identities.
create_cloud_front_origin_access_identityinsertregion, CloudFrontOriginAccessIdentityConfigCreates a new origin access identity. If you're using Amazon S3 for your origin, you can use an origin access identity to require users to access your content using a CloudFront URL instead of the Amazon S3 URL. For more information about how to use origin access identities, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.
update_cloud_front_origin_access_identityupdateid, region, CloudFrontOriginAccessIdentityConfigIf-MatchUpdate an origin access identity.
delete_cloud_front_origin_access_identitydeleteid, regionIf-MatchDelete an origin access identity.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe origin access identity's ID.
regionstringAWS region (default: us-east-1)
If-MatchstringThe value of the ETag header you received from a previous GET or PUT request. For example: E2QWRUHAPOMQZL.
MarkerstringUse this when paginating results to indicate where to begin in your list of origin access identities. The results include identities in the list that occur after the marker. To get the next page of results, set the Marker to the value of the NextMarker from the current page's response (which is also the ID of the last identity on that page).
MaxItemsstringThe maximum number of origin access identities you want in the response body.

SELECT examples

Get the information about an origin access identity.

SELECT
cloud_front_origin_access_identity_config,
id,
s3_canonical_user_id
FROM aws.cloudfront.cloud_front_origin_access_identities
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new origin access identity. If you're using Amazon S3 for your origin, you can use an origin access identity to require users to access your content using a CloudFront URL instead of the Amazon S3 URL. For more information about how to use origin access identities, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

INSERT INTO aws.cloudfront.cloud_front_origin_access_identities (
CloudFrontOriginAccessIdentityConfig,
region
)
SELECT
'{{ CloudFrontOriginAccessIdentityConfig }}' /* required */,
'{{ region }}'
RETURNING
cloud_front_origin_access_identity_config,
id,
s3_canonical_user_id
;

UPDATE examples

Update an origin access identity.

UPDATE aws.cloudfront.cloud_front_origin_access_identities
SET
CloudFrontOriginAccessIdentityConfig = '{{ CloudFrontOriginAccessIdentityConfig }}'
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND CloudFrontOriginAccessIdentityConfig = '{{ CloudFrontOriginAccessIdentityConfig }}' --required
AND `If-Match` = '{{ If-Match}}'
RETURNING
cloud_front_origin_access_identity_config,
id,
s3_canonical_user_id;

DELETE examples

Delete an origin access identity.

DELETE FROM aws.cloudfront.cloud_front_origin_access_identities
WHERE id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND `If-Match` = '{{ If-Match }}'
;