Choosing a network type for serverless caches
ElastiCache serverless caches support the Internet Protocol versions 4 and 6 (IPv4 and IPv6). When creating a serverless cache, you choose one of the following network types:
IPv4 – The cache accepts only IPv4 connections.
IPv6 – The cache accepts only IPv6 connections.
Dual stack – The cache accepts both IPv4 and IPv6 connections.
For dual stack serverless caches, the IP protocol used for a connection depends on how your client resolves the cache endpoint's DNS hostname.
There are no additional charges for accessing ElastiCache over IPv6.
Note
The network type can only be set when creating a serverless cache. You cannot change the network type after the cache is created.
Configuring subnets for network type
When you create a serverless cache, you can provide subnet IDs. ElastiCache uses those subnets to allocate IP addresses for your cache. The subnets you provide must support the network type you choose:
IPv4 – Subnets must have IPv4 address space. Dual stack subnets (with both IPv4 and IPv6) are also supported.
IPv6 – Subnets must be IPv6-only. Dual stack subnets are not supported.
Dual stack – Subnets must have both IPv4 and IPv6 address space.
If you do not specify a network type, ElastiCache defaults to IPv4 unless all provided subnets are IPv6-only, in which case it defaults to IPv6. If you do not provide subnet IDs, ElastiCache selects default subnets in your VPC.
Using the Amazon Management Console
When creating a serverless cache using the console, choose Customize default settings under Default settings. In the Connectivity section, choose a Network type: IPv4, IPv6, or Dual stack. IPv4 is selected by default.
Using the Amazon CLI
When creating a serverless cache using the Amazon CLI, use the
--network-type parameter with the
create-serverless-cache command.
For Linux, OS X, or Unix:
aws elasticache create-serverless-cache \ --serverless-cache-name<cache-name>\ --engine<engine>\ --network-type<network-type>\ --subnet-ids<subnet-id-1><subnet-id-2>
For Windows:
aws elasticache create-serverless-cache ^ --serverless-cache-name<cache-name>^ --engine<engine>^ --network-type<network-type>^ --subnet-ids<subnet-id-1><subnet-id-2>
Replace:
<cache-name>– A name for your serverless cache.<engine>– The engine for your cache:valkey,redis, ormemcached.<network-type>– The network type:ipv4,ipv6, ordual_stack.<subnet-id-1>,<subnet-id-2>– The IDs of the subnets for your cache. The subnets must support the chosen network type.
For more information about the create-serverless-cache command, see create-serverless-cache in the Amazon CLI reference.
For information about choosing a network type for node-based clusters, see Choosing a network type in ElastiCache.