Step 2: Create a cluster - Amazon ElastiCache for Redis

Step 2: Create a cluster

Before creating a cluster for production use, you obviously need to consider how you will configure the cluster to meet your business needs. Those issues are addressed in the Preparing a cluster section. For the purposes of this Getting Started exercise, you will create a cluster with cluster mode disabled and you can accept the default configuration values where they apply.

The cluster you create will be live, and not running in a sandbox. You will incur the standard ElastiCache usage fees for the instance until you delete it. The total charges will be minimal (typically less than a dollar) if you complete the exercise described here in one sitting and delete your cluster when you are finished. For more information about ElastiCache usage rates, see Amazon ElastiCache.

Your cluster is launched in a virtual private cloud (VPC) based on the Amazon VPC service.

Creating a Redis (cluster mode disabled) cluster (Console)

To create a Redis (cluster mode disabled) cluster using the ElastiCache console
  1. Sign in to the AWS Management Console and open the Amazon ElastiCache console at https://console.aws.amazon.com/elasticache/.

  2. From the list in the upper-right corner, choose the AWS Region that you want to launch this cluster in.

  3. Choose Get started from the navigation pane.

  4. Choose Create VPC and follow the steps outlined at Creating a Virtual Private Cloud (VPC).

  5. On the ElastiCache dashboard page, choose Redis cache and then choose Create Redis cache.

  6. Under Cluster settings, do the following:

    1. Choose Configure and create a new cluster.

    2. For Cluster mode, choose Disabled.

    3. For Cluster info enter a value for Name.

    4. (Optional) Enter a value for Description.

  7. Under Location:

    AWS Cloud
    1. For AWS Cloud, we recommend you accept the default settings for Multi-AZ and Auto-failover. For more information, see Minimizing downtime in ElastiCache for Redis with Multi-AZ.

    2. Under Cluster settings

      1. For Engine version, choose an available version.

      2. For Port, use the default port, 6379. If you have a reason to use a different port, enter the port number.

      3. For Parameter group, choose a parameter group or create a new one. Parameter groups control the runtime parameters of your cluster. For more information on parameter groups, see Redis-specific parameters and Creating a parameter group.

        Note

        When you select a parameter group to set the engine configuration values, that parameter group is applied to all clusters in the global datastore. On the Parameter Groups page, the yes/no Global attribute indicates whether a parameter group is part of a global datastore.

      4. For Node type, choose the down arrow ( ). In the Change node type dialog box, choose a value for Instance family for the node type that you want. Then choose the node type that you want to use for this cluster, and then choose Save.

        For more information, see Choosing your node size.

        If you choose an r6gd node type, data-tiering is automatically enabled. For more information, see Data tiering.

      5. For Number of replicas, choose the number of read replicas you want. If you enabled Multi-AZ, the number must be between 1-5.

    3. Under Connectivity

      1. For Network type, choose the IP version(s) this cluster will support.

      2. For Subnet groups, choose the subnet that you want to apply to this cluster. ElastiCache uses that subnet group to choose a subnet and IP addresses within that subnet to associate with your nodes. ElastiCache clusters require a dual-stack subnet with both IPv4 and IPv6 addresses assigned to them to operate in dual-stack mode and an IPv6-only subnet to operate as IPv6-only.

        When creating a new subnet group, enter the VPC ID to which it belongs.

        For more information, see:

        If you are Using local zones with ElastiCache , you must create or choose a subnet that is in the local zone.

        For more information, see Subnets and subnet groups.

    4. For Availability zone placements, you have two options:

      • No preference – ElastiCache chooses the Availability Zone.

      • Specify availability zones – You specify the Availability Zone for each cluster.

        If you chose to specify the Availability Zones, for each cluster in each shard, choose the Availability Zone from the list.

      For more information, see Choosing regions and availability zones.

    5. Choose Next

    6. Under Advanced Redis settings

      1. For Security:

        1. To encrypt your data, you have the following options:

          • Encryption at rest – Enables encryption of data stored on disk. For more information, see Encryption at Rest.

            Note

            You have the option to supply a different encryption key by choosing Customer Managed AWS KMS key and choosing the key. For more information, see Using customer managed keys from AWS KMS.

          • Encryption in-transit – Enables encryption of data on the wire. For more information, see encryption in transit. For Redis engine version 6.0 and above, if you enable Encryption in-transit you will be prompted to specify one of the following Access Control options:

            • No Access Control – This is the default setting. This indicates no restrictions on user access to the cluster.

            • User Group Access Control List – Select a user group with a defined set of users that can access the cluster. For more information, see Managing User Groups with the Console and CLI.

            • Redis AUTH Default User – An authentication mechanism for Redis server. For more information, see Redis AUTH.

          • Redis AUTH – An authentication mechanism for Redis server. For more information, see Redis AUTH.

          Note

          For Redis versions between 3.2.6 onward, excluding version 3.2.10, Redis AUTH is the sole option.

        2. For Security groups, choose the security groups that you want for this cluster. A security group acts as a firewall to control network access to your cluster. You can use the default security group for your VPC or create a new one.

          For more information on security groups, see Security groups for your VPC in the Amazon VPC User Guide.

    7. For regularly scheduled automatic backups, select Enable automatic backups and then enter the number of days that you want each automatic backup retained before it is automatically deleted. If you don't want regularly scheduled automatic backups, clear the Enable automatic backups check box. In either case, you always have the option to create manual backups.

      For more information on Redis backup and restore, see Snapshot and restore.

    8. (Optional) Specify a maintenance window. The maintenance window is the time, generally an hour in length, each week when ElastiCache schedules system maintenance for your cluster. You can allow ElastiCache to choose the day and time for your maintenance window (No preference), or you can choose the day, time, and duration yourself (Specify maintenance window). If you choose Specify maintenance window from the lists, choose the Start day, Start time, and Duration (in hours) for your maintenance window. All times are UCT times.

      For more information, see Managing maintenance.

    9. (Optional) For Logs:

      • Under Log format, choose either Text or JSON.

      • Under Destination Type, choose either CloudWatch Logs or Kinesis Firehose.

      • Under Log destination, choose either Create new and enter either your CloudWatch Logs log group name or your Firehose stream name, or choose Select existing and then choose either your CloudWatch Logs log group name or your Firehose stream name,

    10. For Tags, to help you manage your clusters and other ElastiCache resources, you can assign your own metadata to each resource in the form of tags. For mor information, see Tagging your ElastiCache resources.

    11. Choose Next.

    12. Review all your entries and choices, then make any needed corrections. When you're ready, choose Create.

    On premises
    1. For On premises, we recommend you leave Auto-failover enabled. For more information, see Minimizing downtime in ElastiCache for Redis with Multi-AZ

    2. To finish creating the cluster, follow the steps at Using Outposts.

As soon as your cluster's status is available, you can grant Amazon EC2 access to it, connect to it, and begin using it. For more information, see Step 3: Authorize access to the cluster and Step 4: Connect to the cluster's node.

Important

Once your cluster is available, you're billed for each hour or partial hour that the cluster is active, even if you're not actively using it. To stop incurring charges for this cluster, you must delete it. See Deleting a cluster.

Example

The following CLI code creates a Redis (cluster mode disabled) cache cluster with no replicas.

For Linux, macOS, or Unix:

aws elasticache create-cache-cluster \ --cache-cluster-id my-cluster \ --cache-node-type cache.r4.large \ --engine redis \ --num-cache-nodes 1 \ --snapshot-arns arn:aws:s3:::my_bucket/snapshot.rdb

For Windows:

aws elasticache create-cache-cluster ^ --cache-cluster-id my-cluster ^ --cache-node-type cache.r4.large ^ --engine redis ^ --num-cache-nodes 1 ^ --snapshot-arns arn:aws:s3:::my_bucket/snapshot.rdb

To work with cluster mode enabled, see the following topics: