Class ServerlessCache


  • public class ServerlessCache
    extends com.pulumi.resources.CustomResource
    Provides an ElastiCache Serverless Cache resource which manages memcached, redis or valkey. ## Example Usage ### Memcached Serverless
     
     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 com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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()
                 .cacheUsageLimits(ServerlessCacheCacheUsageLimitsArgs.builder()
                     .dataStorage(ServerlessCacheCacheUsageLimitsDataStorageArgs.builder()
                         .maximum(10)
                         .unit("GB")
                         .build())
                     .ecpuPerSeconds(ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs.builder()
                         .maximum(5000)
                         .build())
                     .build())
                 .engine("memcached")
                 .name("example")
                 .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
     
     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 com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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()
                 .cacheUsageLimits(ServerlessCacheCacheUsageLimitsArgs.builder()
                     .dataStorage(ServerlessCacheCacheUsageLimitsDataStorageArgs.builder()
                         .maximum(10)
                         .unit("GB")
                         .build())
                     .ecpuPerSeconds(ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs.builder()
                         .maximum(5000)
                         .build())
                     .build())
                 .engine("redis")
                 .name("example")
                 .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
     
     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 com.pulumi.aws.elasticache.inputs.ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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()
                 .cacheUsageLimits(ServerlessCacheCacheUsageLimitsArgs.builder()
                     .dataStorage(ServerlessCacheCacheUsageLimitsDataStorageArgs.builder()
                         .maximum(10)
                         .unit("GB")
                         .build())
                     .ecpuPerSeconds(ServerlessCacheCacheUsageLimitsEcpuPerSecondArgs.builder()
                         .maximum(5000)
                         .build())
                     .build())
                 .engine("valkey")
                 .name("example")
                 .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: ```sh $ pulumi import aws:elasticache/serverlessCache:ServerlessCache my_cluster my_cluster ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<ServerlessCacheCacheUsageLimits>> cacheUsageLimits()  
      com.pulumi.core.Output<java.lang.String> createTime()  
      com.pulumi.core.Output<java.lang.String> dailySnapshotTime()  
      com.pulumi.core.Output<java.lang.String> description()  
      com.pulumi.core.Output<java.util.List<ServerlessCacheEndpoint>> endpoints()  
      com.pulumi.core.Output<java.lang.String> engine()  
      com.pulumi.core.Output<java.lang.String> fullEngineVersion()  
      static ServerlessCache get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ServerlessCacheState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyId()  
      com.pulumi.core.Output<java.lang.String> majorEngineVersion()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> networkType()  
      com.pulumi.core.Output<java.util.List<ServerlessCacheReaderEndpoint>> readerEndpoints()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> securityGroupIds()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> snapshotArnsToRestores()  
      com.pulumi.core.Output<java.lang.Integer> snapshotRetentionLimit()  
      com.pulumi.core.Output<java.lang.String> status()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> subnetIds()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.util.Optional<ServerlessCacheTimeouts>> timeouts()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> userGroupId()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServerlessCache

        public ServerlessCache​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • ServerlessCache

        public ServerlessCache​(java.lang.String name,
                               ServerlessCacheArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • ServerlessCache

        public ServerlessCache​(java.lang.String name,
                               ServerlessCacheArgs args,
                               @Nullable
                               com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the serverless cache.
      • cacheUsageLimits

        public com.pulumi.core.Output<java.util.Optional<ServerlessCacheCacheUsageLimits>> cacheUsageLimits()
        Returns:
        Sets the cache usage limits for storage and ElastiCache Processing Units for the cache. See `cacheUsageLimits` Block for details.
      • createTime

        public com.pulumi.core.Output<java.lang.String> createTime()
        Returns:
        Timestamp of when the serverless cache was created.
      • dailySnapshotTime

        public com.pulumi.core.Output<java.lang.String> dailySnapshotTime()
        Returns:
        The daily time that snapshots will be created from the new serverless cache. Only supported for engine types `"redis"` or `"valkey"`. Defaults to `0`.
      • description

        public com.pulumi.core.Output<java.lang.String> description()
        Returns:
        User-provided description for the serverless cache. The default is NULL.
      • endpoints

        public com.pulumi.core.Output<java.util.List<ServerlessCacheEndpoint>> endpoints()
        Returns:
        Represents the information required for client programs to connect to a cache node. See `endpoint` Block for details.
      • engine

        public com.pulumi.core.Output<java.lang.String> engine()
        Returns:
        Name of the cache engine to be used for this cache cluster. Valid values are `memcached`, `redis` or `valkey`.
      • fullEngineVersion

        public com.pulumi.core.Output<java.lang.String> fullEngineVersion()
        Returns:
        The name and version number of the engine the serverless cache is compatible with.
      • kmsKeyId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyId()
        Returns:
        ARN of the customer managed key for encrypting the data at rest. If no KMS key is provided, a default service key is used.
      • majorEngineVersion

        public com.pulumi.core.Output<java.lang.String> majorEngineVersion()
        Returns:
        The version of the cache engine that will be used to create the serverless cache. See [Describe Cache Engine Versions](https://docs.aws.amazon.com/cli/latest/reference/elasticache/describe-cache-engine-versions.html) in the AWS Documentation for supported versions.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The Cluster name which serves as a unique identifier to the serverless cache The following arguments are optional:
      • networkType

        public com.pulumi.core.Output<java.lang.String> networkType()
        Returns:
        IP protocol version used by the serverless cache. Valid values are `ipv4`, `ipv6`, or `dualStack`. `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`.
      • readerEndpoints

        public com.pulumi.core.Output<java.util.List<ServerlessCacheReaderEndpoint>> readerEndpoints()
        Returns:
        Represents the information required for client programs to connect to a cache node. See `readerEndpoint` Block for details.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • securityGroupIds

        public com.pulumi.core.Output<java.util.List<java.lang.String>> securityGroupIds()
        Returns:
        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.
      • snapshotArnsToRestores

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> snapshotArnsToRestores()
        Returns:
        The list of ARN(s) of the snapshot that the new serverless cache will be created from. Only supported for engine types `"redis"` or `"valkey"`.
      • snapshotRetentionLimit

        public com.pulumi.core.Output<java.lang.Integer> snapshotRetentionLimit()
        Returns:
        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. Only supported for engine types `"redis"` or `"valkey"`.
      • status

        public com.pulumi.core.Output<java.lang.String> status()
        Returns:
        The current status of the serverless cache. The allowed values are CREATING, AVAILABLE, DELETING, CREATE-FAILED and MODIFYING.
      • subnetIds

        public com.pulumi.core.Output<java.util.List<java.lang.String>> subnetIds()
        Returns:
        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.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
      • userGroupId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> userGroupId()
        Returns:
        The identifier of the UserGroup to be associated with the serverless cache. Available for Redis and Valkey. Default is NULL.
      • get

        public static ServerlessCache get​(java.lang.String name,
                                          com.pulumi.core.Output<java.lang.String> id,
                                          @Nullable
                                          ServerlessCacheState state,
                                          @Nullable
                                          com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.