Step 2: Create a subnet group - Amazon DynamoDB
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Step 2: Create a subnet group

Follow this procedure to create a subnet group for your Amazon DynamoDB Accelerator (DAX) cluster using the Amazon Command Line Interface (Amazon CLI).


If you already created a subnet group for your default VPC, you can skip this step.

DAX is designed to run within an Amazon Virtual Private Cloud environment (Amazon VPC). If you created your Amazon account after December 4, 2013, you already have a default VPC in each Amazon Region. For more information, see Default VPC and default subnets in the Amazon VPC User Guide.

To create a subnet group
  1. To determine the identifier for your default VPC, enter the following command.

    aws ec2 describe-vpcs

    In the output, note the identifier for your default VPC, as in the following example.


  2. Determine the subnet IDs associated with your default VPC. Replace vpcID with your actual VPC ID—for example, vpc-12345678.

    aws ec2 describe-subnets \ --filters "Name=vpc-id,Values=vpcID" \ --query "Subnets[*].SubnetId"

    In the output, note the subnet identifiers—for example, subnet-11111111.

  3. Create the subnet group. Ensure that you specify at least one subnet ID in the --subnet-ids parameter.

    aws dax create-subnet-group \ --subnet-group-name my-subnet-group \ --subnet-ids subnet-11111111 subnet-22222222 subnet-33333333 subnet-44444444

To create the cluster, see Step 3: Create a DAX cluster using the Amazon CLI.