ServerlessCacheArgs

data class ServerlessCacheArgs(val cacheUsageLimits: Output<ServerlessCacheCacheUsageLimitsArgs>? = null, val dailySnapshotTime: Output<String>? = null, val description: Output<String>? = null, val engine: Output<String>? = null, val kmsKeyId: Output<String>? = null, val majorEngineVersion: Output<String>? = null, val name: Output<String>? = null, val securityGroupIds: Output<List<String>>? = null, val snapshotArnsToRestores: Output<List<String>>? = null, val snapshotRetentionLimit: Output<Int>? = null, val subnetIds: Output<List<String>>? = null, val tags: Output<Map<String, String>>? = null, val timeouts: Output<ServerlessCacheTimeoutsArgs>? = null, val userGroupId: Output<String>? = null) : ConvertibleToJava<ServerlessCacheArgs>

Provides an ElastiCache Serverless Cache resource which manages memcached, redis or valkey.

Example Usage

Memcached Serverless

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.elasticache.ServerlessCache("example", {
engine: "memcached",
name: "example",
cacheUsageLimits: {
dataStorage: {
maximum: 10,
unit: "GB",
},
ecpuPerSeconds: [{
maximum: 5000,
}],
},
description: "Test Server",
kmsKeyId: test.arn,
majorEngineVersion: "1.6",
securityGroupIds: [testAwsSecurityGroup&#46;id],
subnetIds: testAwsSubnet.map(__item => __item.id),
});
import pulumi
import pulumi_aws as aws
example = aws.elasticache.ServerlessCache("example",
engine="memcached",
name="example",
cache_usage_limits={
"data_storage": {
"maximum": 10,
"unit": "GB",
},
"ecpu_per_seconds": [{
"maximum": 5000,
}],
},
description="Test Server",
kms_key_id=test["arn"],
major_engine_version="1.6",
security_group_ids=[test_aws_security_group["id"]],
subnet_ids=[__item["id"] for __item in test_aws_subnet])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.ElastiCache.ServerlessCache("example", new()
{
Engine = "memcached",
Name = "example",
CacheUsageLimits = new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsArgs
{
DataStorage = new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsDataStorageArgs
{
Maximum = 10,
Unit = "GB",
},
EcpuPerSeconds = new[]
{
new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs
{
Maximum = 5000,
},
},
},
Description = "Test Server",
KmsKeyId = test.Arn,
MajorEngineVersion = "1.6",
SecurityGroupIds = new[]
{
testAwsSecurityGroup.Id,
},
SubnetIds = testAwsSubnet.Select(__item => __item.Id).ToList(),
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticache"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
var splat0 []interface{}
for _, val0 := range testAwsSubnet {
splat0 = append(splat0, val0.Id)
}
_, err := elasticache.NewServerlessCache(ctx, "example", &elasticache.ServerlessCacheArgs{
Engine: pulumi.String("memcached"),
Name: pulumi.String("example"),
CacheUsageLimits: &elasticache.ServerlessCacheCacheUsageLimitsArgs{
DataStorage: &elasticache.ServerlessCacheCacheUsageLimitsDataStorageArgs{
Maximum: pulumi.Int(10),
Unit: pulumi.String("GB"),
},
EcpuPerSeconds: elasticache.ServerlessCacheCacheUsageLimitsEcpuPerSecondArray{
&elasticache.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs{
Maximum: pulumi.Int(5000),
},
},
},
Description: pulumi.String("Test Server"),
KmsKeyId: pulumi.Any(test.Arn),
MajorEngineVersion: pulumi.String("1.6"),
SecurityGroupIds: pulumi.StringArray{
testAwsSecurityGroup.Id,
},
SubnetIds: toPulumiArray(splat0),
})
if err != nil {
return err
}
return nil
})
}
func toPulumiArray(arr []) pulumi.Array {
var pulumiArr pulumi.Array
for _, v := range arr {
pulumiArr = append(pulumiArr, pulumi.(v))
}
return pulumiArr
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elasticache.ServerlessCache;
import com.pulumi.aws.elasticache.ServerlessCacheArgs;
import com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsArgs;
import com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsDataStorageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ServerlessCache("example", ServerlessCacheArgs.builder()
.engine("memcached")
.name("example")
.cacheUsageLimits(ServerlessCacheCacheUsageLimitsArgs.builder()
.dataStorage(ServerlessCacheCacheUsageLimitsDataStorageArgs.builder()
.maximum(10)
.unit("GB")
.build())
.ecpuPerSeconds(ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs.builder()
.maximum(5000)
.build())
.build())
.description("Test Server")
.kmsKeyId(test.arn())
.majorEngineVersion("1.6")
.securityGroupIds(testAwsSecurityGroup.id())
.subnetIds(testAwsSubnet.stream().map(element -> element.id()).collect(toList()))
.build());
}
}

Redis OSS Serverless

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.elasticache.ServerlessCache("example", {
engine: "redis",
name: "example",
cacheUsageLimits: {
dataStorage: {
maximum: 10,
unit: "GB",
},
ecpuPerSeconds: [{
maximum: 5000,
}],
},
dailySnapshotTime: "09:00",
description: "Test Server",
kmsKeyId: test.arn,
majorEngineVersion: "7",
snapshotRetentionLimit: 1,
securityGroupIds: [testAwsSecurityGroup&#46;id],
subnetIds: testAwsSubnet.map(__item => __item.id),
});
import pulumi
import pulumi_aws as aws
example = aws.elasticache.ServerlessCache("example",
engine="redis",
name="example",
cache_usage_limits={
"data_storage": {
"maximum": 10,
"unit": "GB",
},
"ecpu_per_seconds": [{
"maximum": 5000,
}],
},
daily_snapshot_time="09:00",
description="Test Server",
kms_key_id=test["arn"],
major_engine_version="7",
snapshot_retention_limit=1,
security_group_ids=[test_aws_security_group["id"]],
subnet_ids=[__item["id"] for __item in test_aws_subnet])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.ElastiCache.ServerlessCache("example", new()
{
Engine = "redis",
Name = "example",
CacheUsageLimits = new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsArgs
{
DataStorage = new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsDataStorageArgs
{
Maximum = 10,
Unit = "GB",
},
EcpuPerSeconds = new[]
{
new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs
{
Maximum = 5000,
},
},
},
DailySnapshotTime = "09:00",
Description = "Test Server",
KmsKeyId = test.Arn,
MajorEngineVersion = "7",
SnapshotRetentionLimit = 1,
SecurityGroupIds = new[]
{
testAwsSecurityGroup.Id,
},
SubnetIds = testAwsSubnet.Select(__item => __item.Id).ToList(),
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticache"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
var splat0 []interface{}
for _, val0 := range testAwsSubnet {
splat0 = append(splat0, val0.Id)
}
_, err := elasticache.NewServerlessCache(ctx, "example", &elasticache.ServerlessCacheArgs{
Engine: pulumi.String("redis"),
Name: pulumi.String("example"),
CacheUsageLimits: &elasticache.ServerlessCacheCacheUsageLimitsArgs{
DataStorage: &elasticache.ServerlessCacheCacheUsageLimitsDataStorageArgs{
Maximum: pulumi.Int(10),
Unit: pulumi.String("GB"),
},
EcpuPerSeconds: elasticache.ServerlessCacheCacheUsageLimitsEcpuPerSecondArray{
&elasticache.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs{
Maximum: pulumi.Int(5000),
},
},
},
DailySnapshotTime: pulumi.String("09:00"),
Description: pulumi.String("Test Server"),
KmsKeyId: pulumi.Any(test.Arn),
MajorEngineVersion: pulumi.String("7"),
SnapshotRetentionLimit: pulumi.Int(1),
SecurityGroupIds: pulumi.StringArray{
testAwsSecurityGroup.Id,
},
SubnetIds: toPulumiArray(splat0),
})
if err != nil {
return err
}
return nil
})
}
func toPulumiArray(arr []) pulumi.Array {
var pulumiArr pulumi.Array
for _, v := range arr {
pulumiArr = append(pulumiArr, pulumi.(v))
}
return pulumiArr
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elasticache.ServerlessCache;
import com.pulumi.aws.elasticache.ServerlessCacheArgs;
import com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsArgs;
import com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsDataStorageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ServerlessCache("example", ServerlessCacheArgs.builder()
.engine("redis")
.name("example")
.cacheUsageLimits(ServerlessCacheCacheUsageLimitsArgs.builder()
.dataStorage(ServerlessCacheCacheUsageLimitsDataStorageArgs.builder()
.maximum(10)
.unit("GB")
.build())
.ecpuPerSeconds(ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs.builder()
.maximum(5000)
.build())
.build())
.dailySnapshotTime("09:00")
.description("Test Server")
.kmsKeyId(test.arn())
.majorEngineVersion("7")
.snapshotRetentionLimit(1)
.securityGroupIds(testAwsSecurityGroup.id())
.subnetIds(testAwsSubnet.stream().map(element -> element.id()).collect(toList()))
.build());
}
}

Valkey Serverless

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.elasticache.ServerlessCache("example", {
engine: "valkey",
name: "example",
cacheUsageLimits: {
dataStorage: {
maximum: 10,
unit: "GB",
},
ecpuPerSeconds: [{
maximum: 5000,
}],
},
dailySnapshotTime: "09:00",
description: "Test Server",
kmsKeyId: test.arn,
majorEngineVersion: "7",
snapshotRetentionLimit: 1,
securityGroupIds: [testAwsSecurityGroup&#46;id],
subnetIds: testAwsSubnet.map(__item => __item.id),
});
import pulumi
import pulumi_aws as aws
example = aws.elasticache.ServerlessCache("example",
engine="valkey",
name="example",
cache_usage_limits={
"data_storage": {
"maximum": 10,
"unit": "GB",
},
"ecpu_per_seconds": [{
"maximum": 5000,
}],
},
daily_snapshot_time="09:00",
description="Test Server",
kms_key_id=test["arn"],
major_engine_version="7",
snapshot_retention_limit=1,
security_group_ids=[test_aws_security_group["id"]],
subnet_ids=[__item["id"] for __item in test_aws_subnet])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.ElastiCache.ServerlessCache("example", new()
{
Engine = "valkey",
Name = "example",
CacheUsageLimits = new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsArgs
{
DataStorage = new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsDataStorageArgs
{
Maximum = 10,
Unit = "GB",
},
EcpuPerSeconds = new[]
{
new Aws.ElastiCache.Inputs.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs
{
Maximum = 5000,
},
},
},
DailySnapshotTime = "09:00",
Description = "Test Server",
KmsKeyId = test.Arn,
MajorEngineVersion = "7",
SnapshotRetentionLimit = 1,
SecurityGroupIds = new[]
{
testAwsSecurityGroup.Id,
},
SubnetIds = testAwsSubnet.Select(__item => __item.Id).ToList(),
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticache"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
var splat0 []interface{}
for _, val0 := range testAwsSubnet {
splat0 = append(splat0, val0.Id)
}
_, err := elasticache.NewServerlessCache(ctx, "example", &elasticache.ServerlessCacheArgs{
Engine: pulumi.String("valkey"),
Name: pulumi.String("example"),
CacheUsageLimits: &elasticache.ServerlessCacheCacheUsageLimitsArgs{
DataStorage: &elasticache.ServerlessCacheCacheUsageLimitsDataStorageArgs{
Maximum: pulumi.Int(10),
Unit: pulumi.String("GB"),
},
EcpuPerSeconds: elasticache.ServerlessCacheCacheUsageLimitsEcpuPerSecondArray{
&elasticache.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs{
Maximum: pulumi.Int(5000),
},
},
},
DailySnapshotTime: pulumi.String("09:00"),
Description: pulumi.String("Test Server"),
KmsKeyId: pulumi.Any(test.Arn),
MajorEngineVersion: pulumi.String("7"),
SnapshotRetentionLimit: pulumi.Int(1),
SecurityGroupIds: pulumi.StringArray{
testAwsSecurityGroup.Id,
},
SubnetIds: toPulumiArray(splat0),
})
if err != nil {
return err
}
return nil
})
}
func toPulumiArray(arr []) pulumi.Array {
var pulumiArr pulumi.Array
for _, v := range arr {
pulumiArr = append(pulumiArr, pulumi.(v))
}
return pulumiArr
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elasticache.ServerlessCache;
import com.pulumi.aws.elasticache.ServerlessCacheArgs;
import com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsArgs;
import com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsDataStorageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ServerlessCache("example", ServerlessCacheArgs.builder()
.engine("valkey")
.name("example")
.cacheUsageLimits(ServerlessCacheCacheUsageLimitsArgs.builder()
.dataStorage(ServerlessCacheCacheUsageLimitsDataStorageArgs.builder()
.maximum(10)
.unit("GB")
.build())
.ecpuPerSeconds(ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs.builder()
.maximum(5000)
.build())
.build())
.dailySnapshotTime("09:00")
.description("Test Server")
.kmsKeyId(test.arn())
.majorEngineVersion("7")
.snapshotRetentionLimit(1)
.securityGroupIds(testAwsSecurityGroup.id())
.subnetIds(testAwsSubnet.stream().map(element -> element.id()).collect(toList()))
.build());
}
}

Import

Using pulumi import, import ElastiCache Serverless Cache using the name. For example:

$ pulumi import aws:elasticache/serverlessCache:ServerlessCache my_cluster my_cluster

Constructors

Link copied to clipboard
constructor(cacheUsageLimits: Output<ServerlessCacheCacheUsageLimitsArgs>? = null, dailySnapshotTime: Output<String>? = null, description: Output<String>? = null, engine: Output<String>? = null, kmsKeyId: Output<String>? = null, majorEngineVersion: Output<String>? = null, name: Output<String>? = null, securityGroupIds: Output<List<String>>? = null, snapshotArnsToRestores: Output<List<String>>? = null, snapshotRetentionLimit: Output<Int>? = null, subnetIds: Output<List<String>>? = null, tags: Output<Map<String, String>>? = null, timeouts: Output<ServerlessCacheTimeoutsArgs>? = null, userGroupId: Output<String>? = null)

Properties

Link copied to clipboard

Sets the cache usage limits for storage and ElastiCache Processing Units for the cache. See cache_usage_limits Block for details.

Link copied to clipboard
val dailySnapshotTime: Output<String>? = null

The daily time that snapshots will be created from the new serverless cache. Only supported for engine types "redis" or "valkey". Defaults to 0.

Link copied to clipboard
val description: Output<String>? = null

User-provided description for the serverless cache. The default is NULL.

Link copied to clipboard
val engine: Output<String>? = null

Name of the cache engine to be used for this cache cluster. Valid values are memcached, redis or valkey.

Link copied to clipboard
val kmsKeyId: Output<String>? = null

ARN of the customer managed key for encrypting the data at rest. If no KMS key is provided, a default service key is used.

Link copied to clipboard
val majorEngineVersion: Output<String>? = null

The version of the cache engine that will be used to create the serverless cache. See Describe Cache Engine Versions in the AWS Documentation for supported versions.

Link copied to clipboard
val name: Output<String>? = null

The Cluster name which serves as a unique identifier to the serverless cache The following arguments are optional:

Link copied to clipboard
val securityGroupIds: Output<List<String>>? = null

A list of the one or more VPC security groups to be associated with the serverless cache. The security group will authorize traffic access for the VPC end-point (private-link). If no other information is given this will be the VPC’s Default Security Group that is associated with the cluster VPC end-point.

Link copied to clipboard
val snapshotArnsToRestores: Output<List<String>>? = null

The list of ARN(s) of the snapshot that the new serverless cache will be created from. Available for Redis only.

Link copied to clipboard
val snapshotRetentionLimit: Output<Int>? = null

The number of snapshots that will be retained for the serverless cache that is being created. As new snapshots beyond this limit are added, the oldest snapshots will be deleted on a rolling basis. Available for Redis only.

Link copied to clipboard
val subnetIds: Output<List<String>>? = null

A 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.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
Link copied to clipboard
val userGroupId: Output<String>? = null

The identifier of the UserGroup to be associated with the serverless cache. Available for Redis only. Default is NULL.

Functions

Link copied to clipboard
open override fun toJava(): ServerlessCacheArgs