origin_access_controls
Creates, updates, deletes, gets or lists an origin_access_controls resource.
Overview
| Name | origin_access_controls |
| Type | Resource |
| Id | aws.cloudfront.origin_access_controls |
Fields
The following fields are returned by SELECT queries:
- get_origin_access_control
- list_origin_access_controls
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the origin access control. |
origin_access_control_config | string | The origin access control. |
| Name | Datatype | Description |
|---|---|---|
is_truncated | boolean | If there are more items in the list than are in this response, this value is true. |
items | string | Contains the origin access controls in the list. |
marker | string | The value of the Marker field that was provided in the request. |
max_items | integer | The maximum number of origin access controls requested. |
next_marker | string | If there are more items in the list than are in this response, this element is present. It contains the value to use in the Marker field of another request to continue listing origin access controls. |
quantity | integer | The number of origin access controls returned in the response. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_origin_access_control | select | id, region | Gets a CloudFront origin access control, including its unique identifier. | |
list_origin_access_controls | select | region | Marker, MaxItems | Gets the list of CloudFront origin access controls (OACs) in this Amazon Web Services account. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send another request that specifies the NextMarker value from the current response as the Marker value in the next request. If you're not using origin access controls for your Amazon Web Services account, the ListOriginAccessControls operation doesn't return the Items element in the response. |
create_origin_access_control | insert | region, OriginAccessControlConfig | Creates 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 Amazon Web Services origin in the Amazon CloudFront Developer Guide. | |
update_origin_access_control | update | id, region, OriginAccessControlConfig | If-Match | Updates a CloudFront origin access control. |
delete_origin_access_control | delete | id, region | If-Match | Deletes a CloudFront origin access control. You cannot delete an origin access control if it's in use. First, update all distributions to remove the origin access control from all origins, then delete the origin access control. |
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.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the origin access control that you are deleting. |
region | string | AWS region (default: us-east-1) |
If-Match | string | The current version (ETag value) of the origin access control that you are deleting. |
Marker | string | Use this field when paginating results to indicate where to begin in your list of origin access controls. The response includes the items in the list that occur after the marker. To get the next page of the list, set this field's value to the value of NextMarker from the current page's response. |
MaxItems | string | The maximum number of origin access controls that you want in the response. |
SELECT examples
- get_origin_access_control
- list_origin_access_controls
Gets a CloudFront origin access control, including its unique identifier.
SELECT
id,
origin_access_control_config
FROM aws.cloudfront.origin_access_controls
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
;
Gets the list of CloudFront origin access controls (OACs) in this Amazon Web Services account. You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send another request that specifies the NextMarker value from the current response as the Marker value in the next request. If you're not using origin access controls for your Amazon Web Services account, the ListOriginAccessControls operation doesn't return the Items element in the response.
SELECT
is_truncated,
items,
marker,
max_items,
next_marker,
quantity
FROM aws.cloudfront.origin_access_controls
WHERE region = '{{ region }}' -- required
AND Marker = '{{ Marker }}'
AND MaxItems = '{{ MaxItems }}'
;
INSERT examples
- create_origin_access_control
- Manifest
Creates 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 Amazon Web Services origin in the Amazon CloudFront Developer Guide.
INSERT INTO aws.cloudfront.origin_access_controls (
OriginAccessControlConfig,
region
)
SELECT
'{{ OriginAccessControlConfig }}' /* required */,
'{{ region }}'
RETURNING
id,
origin_access_control_config
;
# Description fields are for documentation purposes
- name: origin_access_controls
props:
- name: region
value: "{{ region }}"
description: Required parameter for the origin_access_controls resource.
- name: OriginAccessControlConfig
description: |
A CloudFront origin access control configuration.
value:
Name: "{{ Name }}"
Description: "{{ Description }}"
SigningProtocol: "{{ SigningProtocol }}"
SigningBehavior: "{{ SigningBehavior }}"
OriginAccessControlOriginType: "{{ OriginAccessControlOriginType }}"
UPDATE examples
- update_origin_access_control
Updates a CloudFront origin access control.
UPDATE aws.cloudfront.origin_access_controls
SET
OriginAccessControlConfig = '{{ OriginAccessControlConfig }}'
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND OriginAccessControlConfig = '{{ OriginAccessControlConfig }}' --required
AND `If-Match` = '{{ If-Match}}'
RETURNING
id,
origin_access_control_config;
DELETE examples
- delete_origin_access_control
Deletes a CloudFront origin access control. You cannot delete an origin access control if it's in use. First, update all distributions to remove the origin access control from all origins, then delete the origin access control.
DELETE FROM aws.cloudfront.origin_access_controls
WHERE id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND `If-Match` = '{{ If-Match }}'
;