In this tutorial, you will learn how to create a Microsoft SQL Server database Instance (we call this an instance), connect to the database, and delete the DB instance. We will do this using Amazon Relational Database Service (Amazon RDS) and everything done in this tutorial is free tier eligible.

Manage Your AWS Resources

Sign in to the Console

When you click here, the AWS management console will open in a new browser window, so you can keep this step-by-step guide open. When this screen loads, find RDS under Database and click to open the Amazon RDS Console.

AWS Console Image

(click to zoom)

ms-sql-0

In this step, we will use Amazon RDS to create a Microsoft SQL Server DB Instance with db.t2.micro DB instance class, 20 GB of storage, and automated backups enabled with a retention period of one day.  As a reminder, all of this is free tier eligible.


a. In the top right corner of the Amazon RDS console, select the Region in which you want to create the DB instance.

Note: AWS Cloud resources are housed in highly available data center facilities in different areas of the world. Each Region contains multiple distinct locations called Availability Zones. You have the ability to choose which Region to host your Amazon RDS activity in. 

rds-2-location

(click to zoom)

rds-2-location

b.   In the Create database section, choose Create database.

 

 

rds-3-instances

(click to zoom)

rds-3-instances

c.  You now have options to select your engine. For this tutorial, click the Microsoft SQL Server icon. Select SQL Server Express Edition, click Only enable options eligible for RDS Free Usage Tier, and then click Next.
 

ms-sql-5b

(click to zoom)

ms-sql-5b

d. You will now configure your DB instance. To avoid charges, select the checkbox next to 'Only show options that are eligible for RDS Free Tier' and enter the configuration settings listed below in the dropdown: 

Instance specifications:

  • License model: Leave the default value of license-included.
  • DB engine version: Select the default version.
  • DB instance class: Select db.t2.micro --- 1vCPU, 1 GIB RAM. This equates to 1 GB memory and 1 vCPU. To see a list of supported instance classes, see Amazon RDS Product Details.
  • Time zone (optional): Select a time zone, if desired. It's not needed for this tutorial.
  • Storage type: Select General Purpose (SSD). For more information about storage, see Storage for Amazon RDS.
  • Allocated storage: Select the default of 20 to allocate 20 GB of storage for your database. You can scale up to a maximum of 16 TB with Amazon RDS for SQL Server.
  • Enable storage autoscaling: If your workload is cyclical or unpredictable, you would enable storage autoscaling to enable RDS to automatically scale up your storage when needed. This option does not apply to this tutorial.

Settings:

  • DB instance identifier: Type a name for the DB instance that is unique for your account in the Region you selected. For this tutorial, we will name it myrdstest.
  • Master username: Type a username that you will use to log in to your DB instance. We will use masterUsername in this example.
  • Master password: Type a password that contains from 8 to 41 printable ASCII characters (excluding /,", and @) for your master user password.
  • Confirm password: Retype your password.

Click Next.

ms-sql-6a

(click to zoom)

ms-sql-6a

e. You are now on the Configure advanced settings page, where you can provide additional information that RDS needs to launch the Microsoft SQL Server DB instance. Expand the dropdown below to see the example settings for your DB instance.

Network & Security
  • Public accessibility: Choose Yes. This will allocate an IP address for your database instance so that you can directly connect to the database from your own device.
  • VPC security groups: Select Create new VPC security group. This will create a security group that will allow connection from the IP address of the device that you are currently using, to the database created.

Microsoft SQL Server Windows Authentication

  • Directory: Select the default of None.

Database options

  • Port: Leave the default value of 1433.
  • Option group: Select the default value of default.sqlserver-ex-14.00. Amazon RDS uses option groups to enable and configure additional features.  For more information, see Working with Option Groups.

Encryption

This option is not available in the free tier. For more information, see Encrypting Amazon RDS Resources.

Backup

  • Backup retention period: You can choose the number of days to retain the backup you take. For this tutorial, set this value to 1 day.
  • Backup window: Use the default of No Preference.

Monitoring

  • Enhanced monitoring: Use the default of Enable enhanced monitoring. Enabling Enhanced Monitoring will give you metrics in real time for the operating system (OS) that your DB instance runs on. For more information, see Viewing DB Instance Metrics.

Performance Insights

Select Disable Performance Insights for this tutorial.

Maintenance

  • Auto minor version upgrade: Select Enable auto minor version upgrade to receive automatic updates when they become available.
  • Maintenance window: Select No preference.

Deletion protection

Clear Enable deletion protection for this tutorial. When this option is enabled, you can't delete the database.

Click Create database.

ms-sql-7

(click to zoom)

ms-sql-7

f. Your DB Instance is now being created.  Click View Your DB Instances.

Note: Depending on the DB instance class and storage allocated, it could take several minutes for the new DB instance to become available.

The new DB instance appears in the list of DB instances on the RDS console. 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 a database on the DB instance. 

Feel free to move on to the next step as you wait for the DB instance to become available.

ms-sql-8

(click to zoom)

ms-sql-8

Once the database instance creation is complete and the status changes to available, you can connect to a database on the DB instance using any standard SQL client. In this step, we will download Microsoft SQL Server Management Studio Express, a popular client for SQL Server.


a. Go to the Microsoft Download Center - Microsoft SQL Server Management Studio Express page and click Continue.

Note: Remember to download the SQL client to the same device from which you created the RDS DB Instance. The security group your database is placed in is configured to allow connection only from the device from which you created the DB instance.

ms-sql-10

(click to zoom)

ms-sql-10

b. You will be prompted to register with Microsoft -- this step is not required for download.  You can skip registration by selecting the radio button next to 'No, I do not want to register. Take me to the download' and click Next on the popup modal.

Then, select the SQL Management Studio you need and click Next to start your download.

ms-sql-13

(click to zoom)

ms-sql-13

In this step, you will connect to the database you created using SQL Server Management Studio.


a. Once you have completed your download, install and open the program. A dialog box appears.  Enter the following:

  • Server type: Select Database Engine
  • Hostname: Copy and paste the hostname from the Amazon RDS console as shown in the screenshot to the right. Afterwards, change the colon between the DNS and port number to a comma. For example, your server name should look like  sample-instance.cg034hpkmmjt.us-east-1.rds.amazonaws.com,1433.
  • Username: Type in the username you created for the Amazon RDS database.  Our example is 'masterUsername.'
  • Password: Enter the password you used while creating the Amazon RDS database.

Click Connect.

 

ms-sql-14a

(click to zoom)

ms-sql-14a

b. You are now connected to the database. In the SQL Server Management Studio, you will see various schema objects available in the database. Now you can start creating tables, insert data, and run queries.

ms-sql-15

(click to zoom)

ms-sql-15

You can easily delete the Microsoft SQL Server DB Instance from the Amazon RDS console. It is a best practice to delete instances that you are no longer using so that you don’t keep getting charged for them.


a. Go back to your Amazon RDS Console.  Select Databases, choose the instance that you want to delete, and then select Delete from the Actions dropdown menu.

 

ms-sql-17

(click to zoom)

ms-sql-17

b. You are asked to create a final snapshot. For our example, do not create a final snapshot, acknowledge that you want to delete the instance, and then click Delete. 

    Note: Deleting your DB Instance may take a few minutes.

rds-21-deleteInstance

(click to zoom)

rds-21-deleteInstance

You have created, connected to, and deleted a Microsoft SQL Server Database Instance with Amazon RDS.  Amazon RDS makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while managing time-consuming database administration tasks, freeing you up to focus on your applications and business.

Now that you have learned to create and connect to a Microsoft SQL Server Database through Amazon RDS, you can progress to the next tutorial where you will learn to restore a DB Instance from a DB Snapshot.

Create a Web Server and an Amazon RDS Database »

Yes
No