Skip to main content

serverless_caches

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

Overview

Nameserverless_caches
TypeResource
Idaws.elasticache.serverless_caches

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the serverless cache.
cache_usage_limitsstringThe cache usage limit for the serverless cache.
create_timestringWhen the serverless cache was created.
daily_snapshot_timestringThe daily time that a cache snapshot will be created. Default is NULL, i.e. snapshots will not be created at a specific time on a daily basis. Available for Valkey, Redis OSS and Serverless Memcached only.
descriptionstringA description of the serverless cache.
endpointstringRepresents the information required for client programs to connect to a cache node. This value is read-only.
enginestringThe engine the serverless cache is compatible with.
full_engine_versionstringThe name and version number of the engine the serverless cache is compatible with.
kms_key_idstringThe ID of the Amazon Web Services Key Management Service (KMS) key that is used to encrypt data at rest in the serverless cache.
major_engine_versionstringThe version number of the engine the serverless cache is compatible with.
network_typestringThe type of IP address protocol used by the serverless cache. Must be either ipv4 | ipv6 | dual_stack. ipv6 is only supported with IPv6-only subnets. If not specified, defaults to ipv4, unless all provided subnets are IPv6-only, in which case it defaults to ipv6.
reader_endpointstringRepresents the information required for client programs to connect to a cache node. This value is read-only.
security_group_idsstringThe IDs of the EC2 security groups associated with the serverless cache.
serverless_cache_namestringThe unique identifier of the serverless cache.
snapshot_retention_limitintegerThe number of days for which ElastiCache retains automatic snapshots before deleting them. Available for Valkey, Redis OSS and Serverless Memcached only. The maximum value allowed is 35 days.
statusstringThe current status of the serverless cache. The allowed values are CREATING, AVAILABLE, DELETING, CREATE-FAILED and MODIFYING.
storage_encryption_typestringIndicates the type of encryption for data stored at rest in the serverless cache. Serverless caches are always encrypted at rest. The value is sse-elasticache if an ElastiCache service-managed key is used, or sse-kms if a customer-managed KMS key is used.
subnet_idsstringIf no subnet IDs are given and your VPC is in us-west-1, then ElastiCache will select 2 default subnets across AZs in your VPC. For all other Regions, if no subnet IDs are given then ElastiCache will select 3 default subnets across AZs in your default VPC.
user_group_idstringThe identifier of the user group associated with the serverless cache. Available for Valkey and Redis OSS only. Default is NULL.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_serverless_cachesselectregionServerlessCacheName, MaxResults, NextTokenReturns information about a specific serverless cache. If no identifier is specified, then the API returns information on all the serverless caches belonging to this Amazon Web Services account.
create_serverless_cacheinsertServerlessCacheName, regionDescription, Engine, MajorEngineVersion, CacheUsageLimits, KmsKeyId, SecurityGroupIds, SnapshotArnsToRestore, Tags, UserGroupId, SubnetIds, SnapshotRetentionLimit, DailySnapshotTime, NetworkTypeCreates a serverless cache.
modify_serverless_cacheupdateServerlessCacheName, regionDescription, CacheUsageLimits, RemoveUserGroup, UserGroupId, SecurityGroupIds, SnapshotRetentionLimit, DailySnapshotTime, Engine, MajorEngineVersionThis API modifies the attributes of a serverless cache.
delete_serverless_cachedeleteServerlessCacheName, regionFinalSnapshotNameDeletes a specified existing serverless cache. CreateServerlessCacheSnapshot permission is required to create a final snapshot. Without this permission, the API call will fail with an Access Denied exception.
copy_serverless_cache_snapshotexecSourceServerlessCacheSnapshotName, TargetServerlessCacheSnapshotName, regionKmsKeyId, TagsCreates a copy of an existing serverless cache’s snapshot. Available for Valkey, Redis OSS and Serverless Memcached only.
export_serverless_cache_snapshotexecServerlessCacheSnapshotName, S3BucketName, regionProvides the functionality to export the serverless cache snapshot data to Amazon S3. Available for Valkey and Redis OSS only.

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
S3BucketNamestringName of the Amazon S3 bucket to export the snapshot to. The Amazon S3 bucket must also be in same region as the snapshot. Available for Valkey and Redis OSS only.
ServerlessCacheNamestringThe identifier of the serverless cache to be deleted.
ServerlessCacheSnapshotNamestringThe identifier of the serverless cache snapshot to be exported to S3. Available for Valkey and Redis OSS only.
SourceServerlessCacheSnapshotNamestringThe identifier of the existing serverless cache’s snapshot to be copied. Available for Valkey, Redis OSS and Serverless Memcached only.
TargetServerlessCacheSnapshotNamestringThe identifier for the snapshot to be created. Available for Valkey, Redis OSS and Serverless Memcached only. This value is stored as a lowercase string.
regionstringAWS region (default: us-east-1)
CacheUsageLimitsobjectModify the cache usage limit for the serverless cache.
DailySnapshotTimestringThe daily time during which Elasticache begins taking a daily snapshot of the serverless cache. Available for Valkey, Redis OSS and Serverless Memcached only. The default is NULL, i.e. the existing snapshot time configured for the cluster is not removed.
DescriptionstringUser provided description for the serverless cache. Default = NULL, i.e. the existing description is not removed/modified. The description has a maximum length of 255 characters.
EnginestringModifies the engine listed in a serverless cache request. The options are valkey, memcached or redis.
FinalSnapshotNamestringName of the final snapshot to be taken before the serverless cache is deleted. Available for Valkey, Redis OSS and Serverless Memcached only. Default: NULL, i.e. a final snapshot is not taken.
KmsKeyIdstringThe identifier of the KMS key used to encrypt the target snapshot. Available for Valkey, Redis OSS and Serverless Memcached only.
MajorEngineVersionstringModifies the engine vesion listed in a serverless cache request.
MaxResultsintegerThe maximum number of records in the response. If more records exist than the specified max-records value, the next token is included in the response so that remaining results can be retrieved. The default is 50.
NetworkTypestringThe IP protocol version used by the serverless cache. Must be either ipv4 | ipv6 | dual_stack. ipv6 is only supported with IPv6-only subnets. If not specified, defaults to ipv4, unless all provided subnets are IPv6-only, in which case it defaults to ipv6.
NextTokenstringAn optional marker returned from a prior request to support pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxResults.
RemoveUserGroupbooleanThe identifier of the UserGroup to be removed from association with the Valkey and Redis OSS serverless cache. Available for Valkey and Redis OSS only. Default is NULL.
SecurityGroupIdsarrayThe new list of VPC security groups to be associated with the serverless cache. Populating this list means the current VPC security groups will be removed. This security group is used to authorize traffic access for the VPC end-point (private-link). Default = NULL - the existing list of VPC security groups is not removed.
ServerlessCacheNamestringThe identifier for the serverless cache. If this parameter is specified, only information about that specific serverless cache is returned. Default: NULL
SnapshotArnsToRestorearrayThe ARN(s) of the snapshot that the new serverless cache will be created from. Available for Valkey, Redis OSS and Serverless Memcached only.
SnapshotRetentionLimitintegerThe number of days for which Elasticache retains automatic snapshots before deleting them. Available for Valkey, Redis OSS and Serverless Memcached only. Default = NULL, i.e. the existing snapshot-retention-limit will not be removed or modified. The maximum value allowed is 35 days.
SubnetIdsarrayA list of the identifiers of the subnets where the VPC endpoint for the serverless cache will be deployed. All the subnetIds must belong to the same VPC.
TagsarrayA list of tags to be added to the target snapshot resource. A tag is a key-value pair. Available for Valkey, Redis OSS and Serverless Memcached only. Default: NULL
UserGroupIdstringThe identifier of the UserGroup to be associated with the serverless cache. Available for Valkey and Redis OSS only. Default is NULL - the existing UserGroup is not removed.

SELECT examples

Returns information about a specific serverless cache. If no identifier is specified, then the API returns information on all the serverless caches belonging to this Amazon Web Services account.

SELECT
arn,
cache_usage_limits,
create_time,
daily_snapshot_time,
description,
endpoint,
engine,
full_engine_version,
kms_key_id,
major_engine_version,
network_type,
reader_endpoint,
security_group_ids,
serverless_cache_name,
snapshot_retention_limit,
status,
storage_encryption_type,
subnet_ids,
user_group_id
FROM aws.elasticache.serverless_caches
WHERE region = '{{ region }}' -- required
AND ServerlessCacheName = '{{ ServerlessCacheName }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;

INSERT examples

Creates a serverless cache.

INSERT INTO aws.elasticache.serverless_caches (
ServerlessCacheName,
region,
Description,
Engine,
MajorEngineVersion,
CacheUsageLimits,
KmsKeyId,
SecurityGroupIds,
SnapshotArnsToRestore,
Tags,
UserGroupId,
SubnetIds,
SnapshotRetentionLimit,
DailySnapshotTime,
NetworkType
)
SELECT
'{{ ServerlessCacheName }}',
'{{ region }}',
'{{ Description }}',
'{{ Engine }}',
'{{ MajorEngineVersion }}',
'{{ CacheUsageLimits }}',
'{{ KmsKeyId }}',
'{{ SecurityGroupIds }}',
'{{ SnapshotArnsToRestore }}',
'{{ Tags }}',
'{{ UserGroupId }}',
'{{ SubnetIds }}',
'{{ SnapshotRetentionLimit }}',
'{{ DailySnapshotTime }}',
'{{ NetworkType }}'
RETURNING
arn,
cache_usage_limits,
create_time,
daily_snapshot_time,
description,
endpoint,
engine,
full_engine_version,
kms_key_id,
major_engine_version,
network_type,
reader_endpoint,
security_group_ids,
serverless_cache_name,
snapshot_retention_limit,
status,
storage_encryption_type,
subnet_ids,
user_group_id
;

UPDATE examples

This API modifies the attributes of a serverless cache.

UPDATE aws.elasticache.serverless_caches
SET
-- No updatable properties
WHERE
ServerlessCacheName = '{{ ServerlessCacheName }}' --required
AND region = '{{ region }}' --required
AND Description = '{{ Description}}'
AND CacheUsageLimits = '{{ CacheUsageLimits}}'
AND RemoveUserGroup = {{ RemoveUserGroup}}
AND UserGroupId = '{{ UserGroupId}}'
AND SecurityGroupIds = '{{ SecurityGroupIds}}'
AND SnapshotRetentionLimit = '{{ SnapshotRetentionLimit}}'
AND DailySnapshotTime = '{{ DailySnapshotTime}}'
AND Engine = '{{ Engine}}'
AND MajorEngineVersion = '{{ MajorEngineVersion}}'
RETURNING
arn,
cache_usage_limits,
create_time,
daily_snapshot_time,
description,
endpoint,
engine,
full_engine_version,
kms_key_id,
major_engine_version,
network_type,
reader_endpoint,
security_group_ids,
serverless_cache_name,
snapshot_retention_limit,
status,
storage_encryption_type,
subnet_ids,
user_group_id;

DELETE examples

Deletes a specified existing serverless cache. CreateServerlessCacheSnapshot permission is required to create a final snapshot. Without this permission, the API call will fail with an Access Denied exception.

DELETE FROM aws.elasticache.serverless_caches
WHERE ServerlessCacheName = '{{ ServerlessCacheName }}' --required
AND region = '{{ region }}' --required
AND FinalSnapshotName = '{{ FinalSnapshotName }}'
;

Lifecycle Methods

Creates a copy of an existing serverless cache’s snapshot. Available for Valkey, Redis OSS and Serverless Memcached only.

EXEC aws.elasticache.serverless_caches.copy_serverless_cache_snapshot
@SourceServerlessCacheSnapshotName='{{ SourceServerlessCacheSnapshotName }}' --required,
@TargetServerlessCacheSnapshotName='{{ TargetServerlessCacheSnapshotName }}' --required,
@region='{{ region }}' --required,
@KmsKeyId='{{ KmsKeyId }}',
@Tags='{{ Tags }}'
;