public_keys
Creates, updates, deletes, gets or lists a public_keys resource.
Overview
| Name | public_keys |
| Type | Resource |
| Id | aws.cloudfront.public_keys |
Fields
The following fields are returned by SELECT queries:
- get_public_key
- list_public_keys
| Name | Datatype | Description |
|---|---|---|
created_time | string | The date and time when the public key was uploaded. |
id | string | The identifier of the public key. |
public_key_config | string | Configuration information about a public key that you can use with signed URLs and signed cookies, or with field-level encryption. |
| Name | Datatype | Description |
|---|---|---|
items | string | A list of public keys. |
max_items | integer | The maximum number of public keys you want in the response. |
next_marker | string | If there are more elements to be listed, this element is present and contains the value that you can use for the Marker request parameter to continue listing your public keys where you left off. |
quantity | integer | The number of public keys in the list. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_public_key | select | id, region | Gets a public key. | |
list_public_keys | select | region | Marker, MaxItems | List all public keys that have been added to CloudFront for this account. |
create_public_key | insert | region, PublicKeyConfig | Uploads a public key to CloudFront that you can use with signed URLs and signed cookies, or with field-level encryption. | |
update_public_key | update | id, region, PublicKeyConfig | If-Match | Update public key information. Note that the only value you can change is the comment. |
delete_public_key | delete | id, region | If-Match | Remove 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.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the public key you want to remove from CloudFront. |
region | string | AWS region (default: us-east-1) |
If-Match | string | The value of the ETag header that you received when retrieving the public key identity to delete. For example: E2QWRUHAPOMQZL. |
Marker | string | Use 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). |
MaxItems | string | The maximum number of public keys you want in the response body. |
SELECT examples
- get_public_key
- list_public_keys
Gets a public key.
SELECT
created_time,
id,
public_key_config
FROM aws.cloudfront.public_keys
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
;
List all public keys that have been added to CloudFront for this account.
SELECT
items,
max_items,
next_marker,
quantity
FROM aws.cloudfront.public_keys
WHERE region = '{{ region }}' -- required
AND Marker = '{{ Marker }}'
AND MaxItems = '{{ MaxItems }}'
;
INSERT examples
- create_public_key
- Manifest
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
;
# Description fields are for documentation purposes
- name: public_keys
props:
- name: region
value: "{{ region }}"
description: Required parameter for the public_keys resource.
- name: PublicKeyConfig
description: |
Configuration information about a public key that you can use with signed URLs and signed cookies, or with field-level encryption. CloudFront supports signed URLs and signed cookies with RSA 2048 or ECDSA 256 key signatures. Field-level encryption is only compatible with RSA 2048 key signatures.
value:
CallerReference: "{{ CallerReference }}"
Name: "{{ Name }}"
EncodedKey: "{{ EncodedKey }}"
Comment: "{{ Comment }}"
UPDATE examples
- update_public_key
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
- delete_public_key
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 }}'
;