Skip to main content

public_keys

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

Overview

Namepublic_keys
TypeResource
Idaws.cloudfront.public_keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_timestringThe date and time when the public key was uploaded.
idstringThe identifier of the public key.
public_key_configstringConfiguration information about a public key that you can use with signed URLs and signed cookies, or with field-level encryption.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_public_keyselectid, regionGets a public key.
list_public_keysselectregionMarker, MaxItemsList all public keys that have been added to CloudFront for this account.
create_public_keyinsertregion, PublicKeyConfigUploads a public key to CloudFront that you can use with signed URLs and signed cookies, or with field-level encryption.
update_public_keyupdateid, region, PublicKeyConfigIf-MatchUpdate public key information. Note that the only value you can change is the comment.
delete_public_keydeleteid, regionIf-MatchRemove a public key you previously added to CloudFront.

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 ID of the public key you want to remove from CloudFront.
regionstringAWS region (default: us-east-1)
If-MatchstringThe value of the ETag header that you received when retrieving the public key identity to delete. For example: E2QWRUHAPOMQZL.
MarkerstringUse this when paginating results to indicate where to begin in your list of public keys. The results include public keys 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 public key on that page).
MaxItemsstringThe maximum number of public keys you want in the response body.

SELECT examples

Gets a public key.

SELECT
created_time,
id,
public_key_config
FROM aws.cloudfront.public_keys
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Uploads a public key to CloudFront that you can use with signed URLs and signed cookies, or with field-level encryption.

INSERT INTO aws.cloudfront.public_keys (
PublicKeyConfig,
region
)
SELECT
'{{ PublicKeyConfig }}' /* required */,
'{{ region }}'
RETURNING
created_time,
id,
public_key_config
;

UPDATE examples

Update public key information. Note that the only value you can change is the comment.

UPDATE aws.cloudfront.public_keys
SET
PublicKeyConfig = '{{ PublicKeyConfig }}'
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND PublicKeyConfig = '{{ PublicKeyConfig }}' --required
AND `If-Match` = '{{ If-Match}}'
RETURNING
created_time,
id,
public_key_config;

DELETE examples

Remove a public key you previously added to CloudFront.

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