Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Creating an Amazon Aurora DB Cluster

An Amazon Aurora DB cluster is made up of instances that are compatible with MySQL and a cluster volume that represents data copied across three Availability Zones as a single, virtual volume. There are two types of instances in a DB cluster: a primary instance and Aurora Replicas.

The primary instance performs all of the data modifications to the DB cluster and also supports read workloads. Each DB cluster has one primary instance. An Aurora Replica supports only read workloads. Each DB instance can have up to 15 Aurora Replicas. You can connect to any instance in the DB cluster using an endpoint address.

The following topic shows how to create an Aurora DB cluster and then add an Aurora Replica for that DB cluster.

Important

You must complete the tasks in the Setting Up for Amazon RDS section before you can create a DB cluster.

This topic describes how you can create an Amazon Aurora DB cluster using the AWS Management Console. For simple instructions on connecting to your Aurora DB cluster, see Connecting to an Amazon Aurora DB Cluster. For a detailed guide on connecting to an Amazon Aurora DB cluster, see RDS Aurora Connectivity.

DB Cluster Prerequisites

The following are prerequisites to create a DB cluster.

VPC

An Amazon Aurora DB cluster can only be created in an Amazon Virtual Private Cloud (VPC) with at least two subnets in at least two Availability Zones. By distributing your cluster instances across at least two availability zones, you ensure that there will be instances available in your DB cluster in the unlikely case of an Availability Zone failure. Note that the cluster volume for your Aurora DB cluster will always span three availability zones to provide durable storage with less possibility of data loss.

If you are using the Amazon RDS console to create your Aurora DB cluster, then you can have Amazon RDS automatically create a VPC for you. Alternatively, you can use an existing VPC or create a new VPC for your Aurora DB cluster. Your VPC must have at least two subnets in order for you to use it with an Amazon Aurora DB cluster. For more information, see How to Create a VPC for Use with Amazon Aurora. For information on VPCs, see Amazon Virtual Private Cloud (VPCs) and Amazon RDS.

Note

You can communicate with an EC2 instance that is not in a VPC and an Amazon Aurora DB cluster using ClassicLink. For more information, see A DB Instance in a VPC Accessed by an EC2 Instance Not in a VPC.

If you don't have a default VPC or you have not created a VPC, you can have Amazon RDS automatically create a VPC for you when you create an Aurora DB cluster using the RDS console. Otherwise, you must do the following:

  • Create a VPC with at least two subnets in at least two Availability Zones.

  • Specify a VPC security group that authorizes connections to your Aurora DB cluster. For information, go to Working with a DB Instance in a VPC.

  • Specify an RDS DB subnet group that defines at least two subnets in the VPC that can be used by the Aurora DB cluster. For information, see the Working with DB Subnet Groups section in Amazon Virtual Private Cloud (VPCs) and Amazon RDS.

Additional Prerequisites

  • If you are connecting to AWS using IAM credentials, your IAM account must have IAM policies that grant the permissions required to perform Amazon RDS operations. For more information, see Authentication and Access Control for Amazon RDS.

    If you are using an IAM account to access the Amazon Aurora console, you must first log on to the AWS Management Console with your IAM account, and then go to the Aurora console at https://console.aws.amazon.com/rds.

  • If you want to tailor the configuration parameters for your DB cluster, you must specify a DB parameter group with the required parameter settings. For information about creating or modifying a DB parameter group, see Working with DB Parameter Groups.

  • You must determine the TCP/IP port number you will specify for your DB cluster. The firewalls at some companies block connections to the default Aurora port (3306). If your company firewall blocks the default port, choose another port for your DB cluster. All instances in a DB cluster use the same port.

Using the AWS Management Console to Launch an Aurora DB Cluster and Create an Aurora Replica

Launching an Aurora DB Cluster

The following procedures describe how to use the AWS Management Console to launch an Aurora DB cluster and create an Aurora Replica.

To launch an Aurora DB cluster using the console

  1. Open the Amazon Aurora console at https://console.aws.amazon.com/rds.

  2. In the top-right corner of the AWS Management Console, select the region in which you want to create the DB cluster.

  3. In the left navigation pane, click Instances.

  4. Click Launch DB Instance to start the Launch DB Instance wizard. The wizard opens on the Select Engine page.

  5. On the Select Engine page, click the Select button for the Aurora DB engine.

    
                                    Amazon Aurora Launch DB Instance Wizard Select
                                        Engine
  6. On the Specify DB Details page, specify your DB cluster information. The following table shows settings for a DB instance.

    For This Option... Do this

    DB Instance Class

    Select a DB instance class that defines the processing and memory requirements for each instance in the DB cluster. Aurora supports the db.t2.small, db.t2.medium, db.r3.large, db.r3.xlarge, db.r3.2xlarge, db.r3.4xlarge, and db.r3.8xlarge DB instance classes. For more information about DB instance class options, see DB Instance Class.

    Multi-AZ Deployment

    Determine if you want to create Aurora Replicas in other Availability Zones for failover support. If you select Create Replica in Different Zone, then Amazon RDS will create an Aurora Replica for you in your DB cluster in a different Availability Zone than the primary instance for your DB cluster. For more information about multiple Availability Zones, see Regions and Availability Zones.

    DB Instance Identifier

    Type a name for the primary instance in your DB cluster. This identifier will be used in the endpoint address for the primary instance of your DB cluster.

    The DB instance identifier has the following constraints:

    • It must contain from 1 to 63 alphanumeric characters or hyphens.

    • Its first character must be a letter.

    • It cannot end with a hyphen or contain two consecutive hyphens.

    • It must be unique for all DB instances per AWS account, per region.

    Master Username

    Type a name using alphanumeric characters that you will use as the master user name to log on to your DB cluster. The default privileges granted to the master user name account include: create, drop, references, event, alter, delete, index, insert, select, update, create temporary tables, lock tables, trigger, create view, show view, alter routine, create routine, execute, create user, process, show databases, grant option.

    Master Password

    Type a password that contains from 8 to 41 printable ASCII characters (excluding /,", and @) for your master user password.

    A typical Specify DB Details page looks like the following.

    
                                    Amazon Aurora Launch DB Instance Wizard DB Instance
                                        Details
  7. Confirm your master password and click Next.

  8. On the Configure Advanced Settings page, you can customize additional settings for your Aurora DB cluster. The following table shows the advanced settings for a DB cluster.

    For This Option... Do This

    VPC

    Select the VPC that will host the DB cluster. Select Create a New VPC to have Amazon RDS create a VPC for you. For more information, see DB Cluster Prerequisites earlier in this topic.

    Subnet Group

    Select the DB subnet group to use for the DB cluster. Select Create a New DB Subnet Group to have Amazon RDS create a DB subnet group for you. For more information, see DB Cluster Prerequisites earlier in this topic.

    Publicly Accessible

    Select Yes to give the DB cluster a public IP address; otherwise, select No. The instances in your DB cluster can be a mix of both public and private DB instances. For more information about hiding instances from public access, see Hiding a DB Instance in a VPC from the Internet.

    Availability Zone

    Determine if you want to specify a particular Availability Zone. For more information about Availability Zones, see Regions and Availability Zones.

    VPC Security Group(s)

    Select one or more VPC security groups to secure network access to the DB cluster. Select Create a New VPC Security Group to have Amazon RDS create a VPC security group for you. For more information, see DB Cluster Prerequisites earlier in this topic.

    DB Cluster Identifier

    Type a name for your DB cluster that is unique for your account in the region you selected. This identifier will be used in the cluster endpoint address for your DB cluster. For information on the cluster endpoint, see Aurora Endpoints.

    The DB cluster identifier has the following constraints:

    • It must contain from 1 to 63 alphanumeric characters or hyphens.

    • Its first character must be a letter.

    • It cannot end with a hyphen or contain two consecutive hyphens.

    • It must be unique for all DB clusters per AWS account, per region.

    Database Name

    Type a name for your default database of up to 8 alpha-numeric characters. If you don't provide a name, Amazon RDS will not create a database on the DB cluster you are creating.

    To create additional databases, connect to the DB cluster and use the SQL command CREATE DATABASE. For more information about connecting to the DB cluster, see Connecting to an Amazon Aurora DB Cluster.

    Database Port

    Specify the port that applications and utilities will use to access the database. Aurora DB clusters default to the default MySQL port, 3306. The firewalls at some companies block connections to the default MySQL port. If your company firewall blocks the default port, choose another port for the new DB cluster.

    Parameter Group

    Select a parameter group. Aurora has a default parameter group you can use, or you can create your own parameter group. For more information about parameter groups, see Working with DB Parameter Groups.

    Option Group

    Select an option group. Aurora has a default option group you can use, or you can create your own option group. For more information about option groups, see Working with Option Groups.

    Enable IAM DB Authentication

    Select Yes to enable IAM database authentication. For more information, see IAM Database Authentication for MySQL and Amazon Aurora.

    Enable Encryption

    Select Yes to enable encryption at rest for this DB cluster. For more information, see Encrypting Amazon RDS Resources.

    Priority

    Choose a failover priority for the instance. If you don't select a value, the default is tier-1. This priority determines the order in which Aurora Replicas are promoted when recovering from a primary instance failure. For more information, see Fault Tolerance for an Aurora DB Cluster.

    Backup Retention Period

    Select the length of time, from 1 to 35 days, that Aurora will retain backup copies of the database. Backup copies can be used for point-in-time restores (PITR) of your database down to the second.

    Enable Enhanced Monitoring

    Choose Yes to enable gathering metrics in real time for the operating system that your DB cluster runs on. For more information, see Enhanced Monitoring.

    Granularity

    Only available if Enable Enhanced Monitoring is set to Yes. Set the interval, in seconds, between when metrics are collected for your DB cluster.

    Auto Minor Version Upgrade

    Select Yes if you want to enable your Aurora DB cluster to receive minor MySQL DB Engine version upgrades automatically when they become available.

    The Auto Minor Version Upgrade option only applies to upgrades to MySQL minor engine versions for your Amazon Aurora DB cluster. It doesn't apply to regular patches applied to maintain system stability.

    Maintenance Window

    Select the weekly time range during which system maintenance can occur.

    A typical Configure Advanced Settings page looks like the following.

    
                                    Amazon Aurora Launch DB Instance Wizard Configure Advanced
                                        Settings
  9. Click Launch DB Instance to launch your Aurora DB instance, and then click Close to close the wizard.

    On the Amazon RDS console, the new DB instance appears in the list of DB instances. The DB instance will have a status of creating until the DB instance is created and ready for use. When the state changes to available, you can connect to the primary instance for your DB cluster. Depending on the DB instance class and store allocated, it can take several minutes for the new instance to be available.

    To view the newly created cluster, choose the Clusters view in the Amazon RDS console. For more information, see Viewing an Amazon Aurora DB Cluster.

    
                                    Amazon Aurora DB Instances List

    Note the port and the endpoint of the cluster. Use the endpoint and port of the cluster in your JDBC and ODBC connection strings for any application that performs write or read operations.

Creating an Aurora Replica Using the Console

After creating the primary instance for your Aurora DB cluster, you can add up to 15 Aurora Replicas by using the Create Aurora Replica wizard.

Note

Amazon Aurora also supports replication with an external MySQL database, or an RDS MySQL DB instance. When using Amazon Aurora, your RDS MySQL DB instance must be in the same region. For more information, see Replication Between Aurora and MySQL or Between Aurora and Another Aurora DB Cluster.

To create an Aurora Replica by using the AWS Management Console

This example creates an Aurora Replica in the US East (N. Virginia) region.

  1. Open the Amazon Aurora console at https://console.aws.amazon.com/rds.

  2. In the left navigation pane, click Instances.

  3. Click to select the check box to the left of the primary instance for your Aurora DB cluster.

  4. Click Instance Actions, and then click Create Aurora Replica.

  5. On the Create Aurora Replica page, specify options for your Aurora Replica. The following table shows settings for an Aurora Replica.

    For This Option... Do This

    DB Instance Class

    Select a DB instance class that defines the processing and memory requirements for the Aurora Replica. Aurora supports the db.t2.small, db.t2.medium, db.r3.large, db.r3.xlarge, db.r3.2xlarge, db.r3.4xlarge, and db.r3.8xlarge DB instance classes. For more information about DB instance class options, see DB Instance Class.

    Aurora Replica Source

    Select the identifier of the primary instance to create an Aurora Replica for.

    DB Instance Identifier

    Type a name for the instance that is unique for your account in the region you selected. You might choose to add some intelligence to the name such as including the region and DB engine you selected, for example aurora-read-instance1.

    Publicly Accessible

    Select Yes to give the Aurora Replica a public IP address; otherwise, select No. For more information about hiding Aurora Replicas from public access, see Hiding a DB Instance in a VPC from the Internet.

    Availability Zone

    Determine if you want to specify a particular Availability Zone. The list includes only those Availability Zones that are mapped by the DB subnet group you specified earlier. For more information about Availability Zones, see Regions and Availability Zones.

    Priority

    Choose a failover priority for the instance. If you don't select a value, the default is tier-1. This priority determines the order in which Aurora Replicas are promoted when recovering from a primary instance failure. For more information, see Fault Tolerance for an Aurora DB Cluster.

    Database Port

    The port for an Aurora Replica is the same as the port for the DB cluster.

    Auto Minor Version Upgrade

    Select Yes if you want to enable your Aurora Replica to receive minor Aurora DB engine version upgrades automatically when they become available.

    The Auto Minor Version Upgrade option only applies to upgrades to MySQL minor engine versions for your Amazon Aurora DB cluster. It doesn't apply to regular patches applied to maintain system stability.

    A typical Create Aurora Replica page looks like the following.

    
                                    Amazon Aurora Launch DB Instance Wizard Create Aurora
                                        Replica
  6. Click Create Aurora Replica to create the Aurora Replica.

Note the endpoint of the Aurora Replica. Use the endpoint of the Aurora Replica in your JDBC and ODBC connection strings for any application that performs only read operations.

Using the AWS CLI to Launch an Aurora DB Cluster and Create an Aurora Replica

Note

Before you can create an Aurora DB cluster using the AWS CLI, you must fulfill the required prerequisites, such as creating a VPC and an RDS DB subnet group. For more information, see DB Cluster Prerequisites.

To launch an Aurora DB cluster using the AWS CLI

  1. Identify the DB subnet group and VPC security group id for your new cluster, and then call the create-db-cluster AWS CLI command to create the DB cluster.

    For example, the following command creates a new DB cluster named sample-cluster.

    For Linux, OS X, or Unix:

    Copy
    aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora \ --master-username user-name --master-user-password password \ --db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2

    For Windows:

    Copy
    aws rds create-db-cluster --db-cluster-identifier sample-cluster --engine aurora ^ --master-username user-name --master-user-password password ^ --db-subnet-group-name mysubnetgroup --vpc-security-group-ids sg-c7e5b0d2
  2. If you use the console to create a DB cluster, then Amazon RDS automatically creates the primary instance (writer) for your DB cluster. If you use the AWS CLI to create a DB cluster, you must explicitly create the primary instance for your DB cluster. The primary instance is the first instance that is created in a DB cluster.

    Call the create-db-instance AWS CLI command to create the primary instance for your DB cluster. Include the name of the DB cluster as the --db-cluster-identifier parameter value.

    For Linux, OS X, or Unix:

    Copy
    aws rds create-db-instance --db-instance-identifier sample-instance \ --db-cluster-identifier sample-cluster --engine aurora --db-instance-class db.r3.large

    For Windows:

    Copy
    aws rds create-db-instance --db-instance-identifier sample-instance ^ --db-cluster-identifier sample-cluster --engine aurora --db-instance-class db.r3.large

To create an Aurora Replica in a DB cluster using the AWS CLI

After you create the primary instance for a DB cluster, you can create up to 15 Aurora Replicas in your DB cluster to support read-only queries.

We recommend that you distribute the primary instance and Aurora Replicas in your DB cluster over multiple Availabilty Zones to improve the availability of your DB cluster. For more information, see Availability.

Call the create-db-instance AWS CLI command to create an Aurora Replica in your DB cluster. Include the name of the DB cluster as the --db-cluster-identifier parameter value. You can optionally specify an Availability Zone for the Aurora Replica using the --availability-zone parameter, as shown in the following example.

For Linux, OS X, or Unix:

Copy
aws rds create-db-instance --db-instance-identifier sample-instance-us-west-2a \ --db-cluster-identifier sample-cluster --engine aurora --db-instance-class db.r3.large \ --availability-zone us-west-2a

For Windows:

Copy
aws rds create-db-instance --db-instance-identifier sample-instance-us-west-2a ^ --db-cluster-identifier sample-cluster --engine aurora --db-instance-class db.r3.large ^ --availability-zone us-west-2a