ElastiCache clusters should be provisioned in a VPC


Provision your AWS EC2-VPC ElastiCache cluster within the AWS ECS-VPC platform.


Using the EC2-Classic platform minimizes control over cache cluster security and traffic routing. Provisioning with AWS EC2-VPC enables better networking infrastructure, control over VPC security groups, and more.


From the console

Follow the Getting started with Amazon VPC docs to configure AWS EC2-VPC for your ElastiCache clusters.

From the command line

  1. Run create-vpc to create a new Virtual Private Cloud (VPC) for your ElastiCache cluster.


  aws ec2 create-vpc
  1. Run aws ec2 create-internet-gateway to create a new AWS Internet Gateway for your new VPC.

  2. Run attach-internet-gateway with the VPC ID returned in step 1, and the internet gateway ID returned in step 2.


  aws ec2 create-subnet
      --vpc-id vpc-ab12c345
  1. Run create-route-table with your VPC ID created in step 1.


  aws ec2 create-route-table
      --vpc-id vpc-ab12c345
  1. Run associated-route-table with the subnet ID returned in step 3, and the route table ID returned in step 4.


  aws ec2 associate-route-table
    --route-table-id rta-12345678
    --subnet-id subnet-ab123c45
  1. Run create-route to add a new route to your new VPC route table.


  aws ec2 create-route
    --route-table-id rta-12345678
    --gateway-id gwi-123a4b56
  1. Run create-security-group with your new VPC ID to create a security group for your new cluster.


  aws ec2 create-security-group
    --group-name ECSecurityGroup
    --description "Redis CC Security Group"
    --vpc-id vpc-ab12c345
  1. Run authorize-security-group-ingress to add more inbound rules to the security group created in step 7.


  aws ec2 authorize-security-group-ingress
    --group-id se-a12345b0
    --protocol tcp
    --port 1234
  1. Run create-cache-cluster to recreate your EC2-Classic cache cluster within your new AWS VPC. Use the newly created ElastiCache cluster configuration attributes returned in the steps above.


  aws elasticache create-cache-cluster
    --cache-cluster-id vpccachecluster
    --az-mode single-az
    --cache-node-type cache.m5.large
    --num-cache-nodes 1
    --engine redis
    --engine-version "2.6.13"
    --security-group-ids "se-a12345b0"
    --port 1234