Amazon ElastiCache for Redis
ElastiCache for Redis User Guide (API Version 2015-02-02)

Creating a Cluster (AWS CLI)

To create a cluster using the AWS CLI, use the create-cache-cluster command.

Important

As soon as your cluster becomes 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.

Creating a Redis (cluster mode disabled) Cache Cluster (AWS CLI)

Example – A Redis (cluster mode disabled) Cluster with no read replicas

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

If you want to enable in-transit or at-rest encryption on this cluster, add these parameters:

  • -transit-encryption-enabled

    If you enable in-transit encryption, the cluster must be created in a Amazon VPC and you must also include the parameter -cache-subnet-group.

  • -auth-token with the customer specified string value for your AUTH token (password) needed to perform operations on this cluster.

  • -at-rest-encryption-enabled

For Linux, macOS, or Unix:

aws elasticache create-cache-cluster \ --cache-cluster-id my-cluster \ --cache-node-type cache.r4.large \ --engine redis \ --engine-version 3.2.4 \ --num-cache-nodes 1 \ --cache-parameter-group default.redis3.2 \ --snapshot-arns arn:aws:s3:myS3Bucket/snap.rdb

For Windows:

aws elasticache create-cache-cluster ^ --cache-cluster-id my-cluster ^ --cache-node-type cache.r4.large ^ --engine redis ^ --engine-version 3.2.4 ^ --num-cache-nodes 1 ^ --cache-parameter-group default.redis3.2 ^ --snapshot-arns arn:aws:s3:myS3Bucket/snap.rdb

Creating a Redis (cluster mode enabled) Cluster (AWS CLI)

Redis (cluster mode enabled) clusters (API/CLI: replication groups) cannot be created using the create-cache-cluster operation. To create a Redis (cluster mode enabled) cluster (API/CLI: replication group), see Creating a Redis (cluster mode enabled) Replication Group from Scratch (AWS CLI).

For more information, see the AWS CLI for ElastiCache reference topic create-replication-group.