# CfnServerlessCacheProps

Properties for defining a `CfnServerlessCache`.

Used as props by: [CfnServerlessCache](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticache.CfnServerlessCache.html)

- Source: Generated at build time
- Type last changed: v2.273.0 · 8 Oct 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticache as elasticache } from 'aws-cdk-lib';
const cfnServerlessCacheProps: elasticache.CfnServerlessCacheProps = {
  engine: 'engine',
  serverlessCacheName: 'serverlessCacheName',

  // the properties below are optional
  cacheUsageLimits: {
    dataStorage: {
      unit: 'unit',

      // the properties below are optional
      maximum: 123,
      minimum: 123,
    },
    ecpuPerSecond: {
      maximum: 123,
      minimum: 123,
    },
  },
  connectionType: 'connectionType',
  dailySnapshotTime: 'dailySnapshotTime',
  description: 'description',
  endpoint: {
    address: 'address',
    port: 'port',
  },
  finalSnapshotName: 'finalSnapshotName',
  kmsKeyId: 'kmsKeyId',
  majorEngineVersion: 'majorEngineVersion',
  networkType: 'networkType',
  readerEndpoint: {
    address: 'address',
    port: 'port',
  },
  securityGroupIds: ['securityGroupIds'],
  snapshotArnsToRestore: ['snapshotArnsToRestore'],
  snapshotRetentionLimit: 123,
  subnetIds: ['subnetIds'],
  tags: [{
    key: 'key',
    value: 'value',
  }],
  userGroupId: 'userGroupId',
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_elasticache as elasticache

cfn_serverless_cache_props = elasticache.CfnServerlessCacheProps(
    engine="engine",
    serverless_cache_name="serverlessCacheName",

    # the properties below are optional
    cache_usage_limits=elasticache.CfnServerlessCache.CacheUsageLimitsProperty(
        data_storage=elasticache.CfnServerlessCache.DataStorageProperty(
            unit="unit",

            # the properties below are optional
            maximum=123,
            minimum=123
        ),
        ecpu_per_second=elasticache.CfnServerlessCache.ECPUPerSecondProperty(
            maximum=123,
            minimum=123
        )
    ),
    connection_type="connectionType",
    daily_snapshot_time="dailySnapshotTime",
    description="description",
    endpoint=elasticache.CfnServerlessCache.EndpointProperty(
        address="address",
        port="port"
    ),
    final_snapshot_name="finalSnapshotName",
    kms_key_id="kmsKeyId",
    major_engine_version="majorEngineVersion",
    network_type="networkType",
    reader_endpoint=elasticache.CfnServerlessCache.EndpointProperty(
        address="address",
        port="port"
    ),
    security_group_ids=["securityGroupIds"],
    snapshot_arns_to_restore=["snapshotArnsToRestore"],
    snapshot_retention_limit=123,
    subnet_ids=["subnetIds"],
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    user_group_id="userGroupId"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.elasticache.*;

CfnServerlessCacheProps cfnServerlessCacheProps = CfnServerlessCacheProps.builder()
        .engine("engine")
        .serverlessCacheName("serverlessCacheName")

        // the properties below are optional
        .cacheUsageLimits(CacheUsageLimitsProperty.builder()
                .dataStorage(DataStorageProperty.builder()
                        .unit("unit")

                        // the properties below are optional
                        .maximum(123)
                        .minimum(123)
                        .build())
                .ecpuPerSecond(ECPUPerSecondProperty.builder()
                        .maximum(123)
                        .minimum(123)
                        .build())
                .build())
        .connectionType("connectionType")
        .dailySnapshotTime("dailySnapshotTime")
        .description("description")
        .endpoint(EndpointProperty.builder()
                .address("address")
                .port("port")
                .build())
        .finalSnapshotName("finalSnapshotName")
        .kmsKeyId("kmsKeyId")
        .majorEngineVersion("majorEngineVersion")
        .networkType("networkType")
        .readerEndpoint(EndpointProperty.builder()
                .address("address")
                .port("port")
                .build())
        .securityGroupIds(List.of("securityGroupIds"))
        .snapshotArnsToRestore(List.of("snapshotArnsToRestore"))
        .snapshotRetentionLimit(123)
        .subnetIds(List.of("subnetIds"))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .userGroupId("userGroupId")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElastiCache;

var cfnServerlessCacheProps = new CfnServerlessCacheProps {
    Engine = "engine",
    ServerlessCacheName = "serverlessCacheName",

    // the properties below are optional
    CacheUsageLimits = new CacheUsageLimitsProperty {
        DataStorage = new DataStorageProperty {
            Unit = "unit",

            // the properties below are optional
            Maximum = 123,
            Minimum = 123
        },
        EcpuPerSecond = new ECPUPerSecondProperty {
            Maximum = 123,
            Minimum = 123
        }
    },
    ConnectionType = "connectionType",
    DailySnapshotTime = "dailySnapshotTime",
    Description = "description",
    Endpoint = new EndpointProperty {
        Address = "address",
        Port = "port"
    },
    FinalSnapshotName = "finalSnapshotName",
    KmsKeyId = "kmsKeyId",
    MajorEngineVersion = "majorEngineVersion",
    NetworkType = "networkType",
    ReaderEndpoint = new EndpointProperty {
        Address = "address",
        Port = "port"
    },
    SecurityGroupIds = new [] { "securityGroupIds" },
    SnapshotArnsToRestore = new [] { "snapshotArnsToRestore" },
    SnapshotRetentionLimit = 123,
    SubnetIds = new [] { "subnetIds" },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    UserGroupId = "userGroupId"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnServerlessCacheProps := &CfnServerlessCacheProps{
	Engine: jsii.String("engine"),
	ServerlessCacheName: jsii.String("serverlessCacheName"),

	// the properties below are optional
	CacheUsageLimits: &CacheUsageLimitsProperty{
		DataStorage: &DataStorageProperty{
			Unit: jsii.String("unit"),

			// the properties below are optional
			Maximum: jsii.Number(123),
			Minimum: jsii.Number(123),
		},
		EcpuPerSecond: &ECPUPerSecondProperty{
			Maximum: jsii.Number(123),
			Minimum: jsii.Number(123),
		},
	},
	ConnectionType: jsii.String("connectionType"),
	DailySnapshotTime: jsii.String("dailySnapshotTime"),
	Description: jsii.String("description"),
	Endpoint: &EndpointProperty{
		Address: jsii.String("address"),
		Port: jsii.String("port"),
	},
	FinalSnapshotName: jsii.String("finalSnapshotName"),
	KmsKeyId: jsii.String("kmsKeyId"),
	MajorEngineVersion: jsii.String("majorEngineVersion"),
	NetworkType: jsii.String("networkType"),
	ReaderEndpoint: &EndpointProperty{
		Address: jsii.String("address"),
		Port: jsii.String("port"),
	},
	SecurityGroupIds: []interface{}{
		jsii.String("securityGroupIds"),
	},
	SnapshotArnsToRestore: []*string{
		jsii.String("snapshotArnsToRestore"),
	},
	SnapshotRetentionLimit: jsii.Number(123),
	SubnetIds: []interface{}{
		jsii.String("subnetIds"),
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	UserGroupId: jsii.String("userGroupId"),
}
```

## Properties

- `cacheUsageLimits`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnServerlessCache.CacheUsageLimitsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticache.CfnServerlessCache.CacheUsageLimitsProperty.html) — The cache usage limit for the serverless cache.

- `connectionType`: string — The connection type for the serverless cache.

  Valid values are vpc or public.

- `dailySnapshotTime`: string — The 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.

- `description`: string — A description of the serverless cache.

- `endpoint`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnServerlessCache.EndpointProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticache.CfnServerlessCache.EndpointProperty.html) — Represents the information required for client programs to connect to a cache node.

  This value is read-only.

- `engine`: string (required) — The engine the serverless cache is compatible with.

- `finalSnapshotName`: string — The name of the final snapshot taken of a cache before the cache is deleted.

- `kmsKeyId`: string | [IKeyRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_kms.IKeyRef.html) — The ID of the AWS Key Management Service (KMS) key that is used to encrypt data at rest in the serverless cache.

- `majorEngineVersion`: string — The version number of the engine the serverless cache is compatible with.

- `networkType`: string — The network type for the serverless cache.

  Valid values are ipv4, ipv6, or dual_stack.

- `readerEndpoint`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnServerlessCache.EndpointProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticache.CfnServerlessCache.EndpointProperty.html) — Represents the information required for client programs to connect to a cache node.

  This value is read-only.

- `securityGroupIds`: string | [ISecurityGroupRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ISecurityGroupRef.html)[] — The IDs of the EC2 security groups associated with the serverless cache.

- `serverlessCacheName`: string (required) — The unique identifier of the serverless cache.

- `snapshotArnsToRestore`: string[] — The ARN of the snapshot from which to restore data into the new cache.

- `snapshotRetentionLimit`: number — The current setting for the number of serverless cache snapshots the system will retain.

  Available for Valkey, Redis OSS and Serverless Memcached only.

- `subnetIds`: string | [ISubnetRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ISubnetRef.html)[] — If 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.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — A list of tags to be added to this resource.

- `userGroupId`: string | [IUserGroupRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_elasticache.IUserGroupRef.html) — The identifier of the user group associated with the serverless cache.

  Available for Valkey and Redis OSS only. Default is NULL.
