Amazon Relational Database Service (Amazon RDS) Custom offers a managed database service that grants administrative access to the underlying operating system and database environment. This enables the execution of third-party applications, driver installations, and access to native features of SQL Server or Windows—all while enjoying the advantages of a managed database service. Additionally, users can utilize the SQL Server Developer Edition or apply existing SQL Server licenses through the Bring Your Own Media capability.
In this article, we detail the process of setting up RDS Custom dependencies and launching the RDS Custom instance using a predefined AWS CloudFormation template. We will also guide you through creating a Custom Engine Version (CEV) using the AWS CLI. For those who prefer to launch an instance via the RDS Console rather than through CloudFormation, we recommend checking out this getting started guide instead, which uses CloudFormation solely to establish the prerequisites for RDS Custom.
Solution Overview
The chart below summarizes the resources needed to launch an RDS Custom instance:
The implementation of this solution generally involves the following high-level steps:
- Establish a network setup, including VPC, subnets, and security groups.
- Create an Amazon IAM instance profile.
- Generate an Amazon KMS key.
- Launch an Amazon EC2 instance with a Windows AMI.
- Connect to the RDS Custom for SQL Server instance using SQL Server Management Studio (SSMS) or another client.
This post is divided into two primary approaches for launching an Amazon RDS Custom for SQL Server instance via CloudFormation:
- Launching an RDS Custom for SQL Server in a new VPC
- Launching an RDS Custom for SQL Server in an existing VPC
Prerequisites
Before starting, ensure you have the following:
- A fundamental understanding of CloudFormation and how to use templates
- Familiarity with the environmental setup for Amazon RDS Custom for SQL Server
For pricing information, please refer to the Amazon RDS Custom pricing page.
Launching an RDS Custom for SQL Server Instance in a New VPC
To launch an RDS Custom SQL Server instance in a new VPC, follow these steps:
- Download the CloudFormation template.
- Open the CloudFormation console and complete the prerequisites for RDS Custom for SQL Server by launching the networking stack.
- Create the CloudFormation stack.
The stack creation may take approximately 30 to 40 minutes to complete. For detailed information regarding the parameters passed during the network setup, refer to their documentation.
The outputs from the customsqlserver-network-prereq
stack will display the resources deployed.
(Optional) To ensure your changes to the C: drive persist despite events like disk corruptions or failovers, consider using a customized AMI as a foundation for RDS Custom, referred to as a Custom Engine Version (CEV). This involves taking your AMI, customizing it, and subsequently creating a CEV from it. If you prefer not to use a CEV, you may opt for an RDS-Provided Engine version, which includes a standard AMI and SQL Server installation. For a comprehensive guide on creating a CEV using SQL Server Developer Edition, visit this resource.
The command below illustrates how to create a custom engine version (CEV) to maintain your preferred baseline configuration of the OS and database:
aws rds create-custom-db-engine-version
--engine custom-sqlserver-ee
--engine-version 15.00.4249.2.my_cevtest
--image-id <ami-id>
--kms-key-id <my-kms-key>
--description "Custom SQL Server EE 15.00.4249.2 cev test"
For further information, refer to the documentation on creating a custom DB engine version. When preparing your AMI, ensure that it is located in the same AWS account and Region as your CEV; otherwise, the creation process will fail. Additionally, the AMI must be prepared using Sysprep. For more details on this process, see the guide on persisting OS-level customizations within Amazon RDS Custom for SQL Server using CEV.
Creating AWS Resources Using a CloudFormation Template
To create AWS resources via a CloudFormation template, follow these steps:
- Download the CloudFormation Template.
- In the AWS CloudFormation Console, click on Create stack.
- Select With new resources (standard).
- For Template source, choose Upload a template file and select the downloaded file.
- Click Next and fill in the parameters as specified in the CloudFormation stack.
The parameters include:
- Engine
- EngineVersion (if not using CEV, use the default RDS engine version, e.g., 15.00.4261.1.v1)
- DBInstanceClass
After entering the parameters, proceed to deploy the stack. For Stack name, enter a name such as “customsqlserver-provisioning.” Review the parameters and click on Create stack. The stack creation process will take approximately 30 to 40 minutes to complete. Upon completion, navigate to the stack (customsqlserver-provisioning) and select the Resources tab to review the created resources. Check the Outputs tab for relevant details.
Now, let’s verify the Amazon RDS Custom SQL Server Database instance in the Amazon RDS Service.
Launching an RDS Custom for SQL Server in an Existing VPC
If you already have an existing VPC, follow these steps to create a custom SQL Server DB instance:
- Download the CloudFormation Template.
- In the AWS CloudFormation Console, select Create stack.
- Choose With new resources (standard).
- For Template source, select Upload a template file and choose the downloaded file.
- Click Next and fill in the parameters as specified in the CloudFormation stack.
By following these steps, you can successfully launch an Amazon RDS Custom for SQL Server instance tailored to your needs.
For more information about Amazon RDS, check out this excellent resource here.
Leave a Reply