Skip to main content

cloud_front_origin_access_identities

Creates, updates, deletes or gets a cloud_front_origin_access_identity resource or lists cloud_front_origin_access_identities in a region

Overview

Namecloud_front_origin_access_identities
TypeResource
DescriptionThe request to create a new origin access identity (OAI). An origin access identity is a special CloudFront user that you can associate with Amazon S3 origins, so that you can secure all or just some of your Amazon S3 content. For more information, see Restricting Access to Amazon S3 Content by Using an Origin Access Identity in the Amazon CloudFront Developer Guide.
Idawscc.cloudfront.cloud_front_origin_access_identities

Fields

NameDatatypeDescription
cloud_front_origin_access_identity_configobjectThe current configuration information for the identity.
idstring
s3_canonical_user_idstring
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcecloud_front_origin_access_identitiesINSERTCloudFrontOriginAccessIdentityConfig, region
delete_resourcecloud_front_origin_access_identitiesDELETEIdentifier, region
update_resourcecloud_front_origin_access_identitiesUPDATEIdentifier, PatchDocument, region
list_resourcescloud_front_origin_access_identities_list_onlySELECTregion
get_resourcecloud_front_origin_access_identitiesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual cloud_front_origin_access_identity.

SELECT
region,
cloud_front_origin_access_identity_config,
id,
s3_canonical_user_id
FROM awscc.cloudfront.cloud_front_origin_access_identities
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.cloudfront.cloud_front_origin_access_identities (
CloudFrontOriginAccessIdentityConfig,
region
)
SELECT
'{{ cloud_front_origin_access_identity_config }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a cloud_front_origin_access_identity resource, using stack-deploy.

/*+ update */
UPDATE awscc.cloudfront.cloud_front_origin_access_identities
SET PatchDocument = string('{{ {
"CloudFrontOriginAccessIdentityConfig": cloud_front_origin_access_identity_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.cloudfront.cloud_front_origin_access_identities
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

cloudfront:CreateCloudFrontOriginAccessIdentity