keys
Creates, updates, deletes, gets or lists a keys resource.
Overview
| Name | keys |
| Type | Resource |
| Id | aws.cloudfront_keyvaluestore.keys |
Fields
The following fields are returned by SELECT queries:
- get_key
- list_keys
| Name | Datatype | Description |
|---|---|---|
item_count | integer | Number of key value pairs in the Key Value Store. |
key | string | The key of the key value pair. |
total_size_in_bytes | integer (int64) | Total size of the Key Value Store in bytes. |
value | string | The value of the key value pair. |
| Name | Datatype | Description |
|---|---|---|
key | string | The key of the key value pair. |
value | string | The value of the key value pair. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_key | select | kvs_arn, key, region | Returns a key value pair. | |
list_keys | select | kvs_arn, region | NextToken, MaxResults | Returns a list of key value pairs. |
update_keys | update | kvs_arn, If-Match, region | Puts or Deletes multiple key value pairs in a single, all-or-nothing operation. | |
put_key | replace | key, kvs_arn, If-Match, region | Creates a new key value pair or replaces the value of an existing key. | |
delete_key | delete | kvs_arn, key, If-Match, region | Deletes the key value pair specified by the key. |
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 |
|---|---|---|
If-Match | string | The current version (ETag) of the Key Value Store that you are deleting keys from, which you can get using DescribeKeyValueStore. |
key | string | The key to delete. |
kvs_arn | string | The Amazon Resource Name (ARN) of the Key Value Store. |
region | string | AWS region (default: us-east-1) |
MaxResults | integer | Maximum number of results that are returned per call. The default is 10 and maximum allowed page is 50. |
NextToken | string | If nextToken is returned in the response, there are more results available. Make the next call using the returned token to retrieve the next page. |
SELECT examples
- get_key
- list_keys
Returns a key value pair.
SELECT
item_count,
key,
total_size_in_bytes,
value
FROM aws.cloudfront_keyvaluestore.keys
WHERE kvs_arn = '{{ kvs_arn }}' -- required
AND key = '{{ key }}' -- required
AND region = '{{ region }}' -- required
;
Returns a list of key value pairs.
SELECT
key,
value
FROM aws.cloudfront_keyvaluestore.keys
WHERE kvs_arn = '{{ kvs_arn }}' -- required
AND region = '{{ region }}' -- required
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
;
UPDATE examples
- update_keys
Puts or Deletes multiple key value pairs in a single, all-or-nothing operation.
UPDATE aws.cloudfront_keyvaluestore.keys
SET
Puts = '{{ Puts }}',
Deletes = '{{ Deletes }}'
WHERE
kvs_arn = '{{ kvs_arn }}' --required
AND `If-Match` = '{{ If-Match }}' --required
AND region = '{{ region }}' --required
RETURNING
e_tag,
item_count,
total_size_in_bytes;
REPLACE examples
- put_key
Creates a new key value pair or replaces the value of an existing key.
REPLACE aws.cloudfront_keyvaluestore.keys
SET
Value = '{{ Value }}'
WHERE
key = '{{ key }}' --required
AND kvs_arn = '{{ kvs_arn }}' --required
AND `If-Match` = '{{ If-Match }}' --required
AND region = '{{ region }}' --required
RETURNING
e_tag,
item_count,
total_size_in_bytes;
DELETE examples
- delete_key
Deletes the key value pair specified by the key.
DELETE FROM aws.cloudfront_keyvaluestore.keys
WHERE kvs_arn = '{{ kvs_arn }}' --required
AND key = '{{ key }}' --required
AND `If-Match` = '{{ If-Match }}' --required
AND region = '{{ region }}' --required
;