

# Working with RDS Custom for SQL Server
<a name="working-with-custom-sqlserver"></a>

Following, you can find instructions for creating, managing, and maintaining your RDS Custom for SQL Server DB instances.

**Topics**
+ [

# RDS Custom for SQL Server workflow
](custom-sqlserver.workflow.md)
+ [

# Requirements and limitations for Amazon RDS Custom for SQL Server
](custom-reqs-limits-MS.md)
+ [

# Setting up your environment for Amazon RDS Custom for SQL Server
](custom-setup-sqlserver.md)
+ [

# Bring Your Own Media with RDS Custom for SQL Server
](custom-sqlserver.byom.md)
+ [

# Working with custom engine versions for RDS Custom for SQL Server
](custom-cev-sqlserver.md)
+ [

# Creating and connecting to a DB instance for Amazon RDS Custom for SQL Server
](custom-creating-sqlserver.md)
+ [

# Managing an Amazon RDS Custom for SQL Server DB instance
](custom-managing-sqlserver.md)
+ [

# Working with Microsoft Active Directory with RDS Custom for SQL Server
](custom-sqlserver-WinAuth.md)
+ [

# Managing a Multi-AZ deployment for RDS Custom for SQL Server
](custom-sqlserver-multiaz.md)
+ [

# Backing up and restoring an Amazon RDS Custom for SQL Server DB instance
](custom-backup-sqlserver.md)
+ [

# Copying an Amazon RDS Custom for SQL Server DB snapshot
](custom-copying-snapshot-sqlserver.md)
+ [

# Migrating an on-premises database to Amazon RDS Custom for SQL Server
](custom-migrating.md)
+ [

# RDS Custom for SQL Server Operating system updates
](custom-os-upgrade.md)
+ [

# Upgrading an Amazon RDS Custom for SQL Server DB instance
](custom-upgrading-sqlserver.md)
+ [

# Troubleshooting DB issues for Amazon RDS Custom for SQL Server
](custom-troubleshooting-sqlserver.md)

# RDS Custom for SQL Server workflow
<a name="custom-sqlserver.workflow"></a>

The following diagram shows the typical workflow for RDS Custom for SQL Server.

![\[RDS Custom for SQL Server architecture\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/custom_sqlserver_architecture_v2.png)


The steps are as follows:

1. Create an RDS Custom for SQL Server DB instance from an engine version offered by RDS Custom.

   For more information, see [Creating an RDS Custom for SQL Server DB instance](custom-creating-sqlserver.md#custom-creating-sqlserver.create).

1. Connect your application to the RDS Custom DB instance endpoint.

   For more information, see [Connecting to your RDS Custom DB instance using AWS Systems Manager](custom-creating-sqlserver.ssm.md) and [Connecting to your RDS Custom DB instance using RDP](custom-creating-sqlserver.rdp.md).

1. (Optional) Access the host to customize your software.

1. Monitor notifications and messages generated by RDS Custom automation.

## Creating a DB instance for RDS Custom
<a name="custom-sqlserver.workflow.instance"></a>

You create your RDS Custom DB instance using the `create-db-instance` command. The procedure is similar to creating an Amazon RDS instance. However, some of the parameters are different. For more information, see [Creating and connecting to a DB instance for Amazon RDS Custom for SQL Server](custom-creating-sqlserver.md).

## Database connection
<a name="custom-sqlserver.workflow.db-connection"></a>

Like an Amazon RDS DB instance, your RDS Custom for SQL Server DB instance resides in a VPC. Your application connects to the RDS Custom instance using a client such as SQL Server Management Suite (SSMS), just as in RDS for SQL Server.

## RDS Custom customization
<a name="custom-sqlserver.workflow.customization"></a>

You can access the RDS Custom host to install or customize software. To avoid conflicts between your changes and the RDS Custom automation, you can pause the automation for a specified period. During this period, RDS Custom doesn't perform monitoring or instance recovery. At the end of the period, RDS Custom resumes full automation. For more information, see [Pausing and resuming RDS Custom automation](custom-managing-sqlserver.pausing.md).

# Requirements and limitations for Amazon RDS Custom for SQL Server
<a name="custom-reqs-limits-MS"></a>

Following, you can find a summary of the Amazon RDS Custom for SQL Server requirements and limitations for quick reference. Requirements and limitations also appear in the relevant sections.

**Topics**
+ [

## Region and version availability
](#custom-reqs-limits-MS.RegionVersionAvailability)
+ [

## General requirements for RDS Custom for SQL Server
](#custom-reqs-limits.reqsMS)
+ [

# DB instance class support for RDS Custom for SQL Server
](custom-reqs-limits.instancesMS.md)
+ [

## Limitations for RDS Custom for SQL Server
](#custom-reqs-limits.limitsMS)
+ [

# Setting character sets and collations for RDS Custom for SQL Server DB instances
](custom-reqs-limits-MS.collation.md)
+ [

# Local time zone for RDS Custom for SQL Server DB instances
](custom-reqs-limits-MS.TimeZone.md)
+ [

# Using a Service Master Key with RDS Custom for SQL Server
](custom-sqlserver-features.smk.md)
+ [

# Change data capture (CDC) support with RDS Custom for SQL Server
](custom-sqlserver-features.cdc.md)

## Region and version availability
<a name="custom-reqs-limits-MS.RegionVersionAvailability"></a>

Feature availability and support varies across specific versions of each database engine, and across AWS Regions. For more information on version and Region availability of Amazon RDS with Amazon RDS Custom for SQL Server, see [Supported Regions and DB engines for RDS Custom for SQL Server](Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.md#Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.sq). 

## General requirements for RDS Custom for SQL Server
<a name="custom-reqs-limits.reqsMS"></a>

Make sure to follow these requirements for Amazon RDS Custom for SQL Server:
+ Use the instance classes shown in [DB instance class support for RDS Custom for SQL Server](custom-reqs-limits.instancesMS.md). The only storage types supported are solid state drives (SSD) of types gp2, gp3, io1, and io2 Block Express. The maximum storage limit for io1, gp2, and gp3 is 16 TiB while io2 supports 64 TiB.
+ Make sure that you have a symmetric encryption AWS KMS key to create an RDS Custom DB instance. For more information, see [Make sure that you have a symmetric encryption AWS KMS key](custom-setup-sqlserver.md#custom-setup-sqlserver.cmk).
+ Make sure that you create an AWS Identity and Access Management (IAM) role and instance profile. For more information, see [Creating your IAM role and instance profile manually](custom-setup-sqlserver.md#custom-setup-sqlserver.iam) and [Automated instance profile creation using the AWS Management Console](custom-setup-sqlserver.md#custom-setup-sqlserver.instanceProfileCreation).
+ Make sure to supply a networking configuration that RDS Custom can use to access other AWS services. For specific requirements, see [Step 2: Configure networking, instance profile, and encryption](custom-setup-sqlserver.md#custom-setup-sqlserver.iam-vpc).
+ The combined number of RDS Custom and Amazon RDS DB instances can't exceed your quota limit. For example, if your quota is 40 DB instances, you can have 20 RDS Custom for SQL Server DB instances and 20 Amazon RDS DB instances.
+ RDS Custom automatically creates an AWS CloudTrail trail whose name begins with `do-not-delete-rds-custom-`. The RDS Custom support perimeter relies on the events from CloudTrail to determine whether your actions affect RDS Custom automation. RDS Custom creates the trail when you create your first DB instance. To use an already existing CloudTrail, contact AWS Support. For more information, see [AWS CloudTrail](custom-concept.md#custom-concept.components.CloudTrail).

# DB instance class support for RDS Custom for SQL Server
<a name="custom-reqs-limits.instancesMS"></a>

Check if the DB instance class is supported in your Region by using the [ describe-orderable-db-instance-options](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/describe-orderable-db-instance-options.html) command.

RDS Custom for SQL Server supports the DB instance classes shown in the following table:


| SQL Server edition | RDS Custom support | 
| --- | --- | 
|  Enterprise Edition  |  db.r5.xlarge–db.r5.24xlarge db.r5b.xlarge–db.r5b.24xlarge db.m5.xlarge–db.m5.24xlarge db.r6i.xlarge–db.r6i.32xlarge db.m6i.xlarge–db.m6i.32xlarge db.x2iedn.xlarge–db.x2iedn.32xlarge  | 
|  Standard Edition  |  db.r5.large–db.r5.24xlarge db.r5b.large–db.r5b.8xlarge db.m5.large–db.m5.24xlarge db.r6i.large–db.r6i.8xlarge db.m6i.large–db.m6i.8xlarge db.x2iedn.xlarge–db.x2iedn.8xlarge  | 
|  Developer Edition  |  db.r5.xlarge–db.r5.24xlarge db.r5b.xlarge–db.r5b.24xlarge db.m5.xlarge–db.m5.24xlarge db.r6i.xlarge–db.r6i.32xlarge db.m6i.xlarge–db.m6i.32xlarge db.x2iedn.xlarge–db.x2iedn.32xlarge  | 
|  Web Edition  |  db.r5.large–db.r5.4xlarge db.m5.large–db.m5.4xlarge db.r6i.large–db.r6i.4xlarge db.m6i.large–db.m6i.4xlarge db.r5b.large–db.r5b.4xlarge  | 

The following recommendations apply to db.x2iedn class types:
+ At creation, local storage is a raw and unallocated device. Before using a DB instance with this instance class, you must mount and format the local storage. Afterward, configure `tempdb` on it to ensure optimal performance. For more information, see [Optimize tempdb performance in Amazon RDS Custom for SQL Server using local instance storage](https://aws.amazon.com/blogs/database/optimize-tempdb-performance-in-amazon-rds-custom-for-sql-server-using-local-instance-storage/).
+ Local storage reverts to its raw and unallocated state when you run DB instance operations such as scale compute, instance replacement, snapshot restore, or point-in-time recovery (PITR). In these situations, you must remount, reformat, and reconfigure the drive and `tempdb` to restore functionality.
+ For Multi-AZ instances, we recommend that you perform the configuration on a standby DB instance. This way, if a failover occurs, the system continues to operate without issues because the configuration is already in place on the standby instance.

## Limitations for RDS Custom for SQL Server
<a name="custom-reqs-limits.limitsMS"></a>

The following limitations apply to RDS Custom for SQL Server:
+ You can't create read replicas in Amazon RDS for RDS Custom for SQL Server DB instances. However, you can configure high availability automatically with a Multi-AZ deployment. For more information, see [Managing a Multi-AZ deployment for RDS Custom for SQL Server](custom-sqlserver-multiaz.md).
+ You can't modify the DB instance identifier of an existing RDS Custom for SQL Server DB instance.
+ For an RDS Custom for SQL Server DB instance that wasn't created with a custom engine version (CEV), changes to the Microsoft Windows operating system aren't guaranteed to persist. For example, you lose these changes when you initiate a snapshot or point-in-time restore operation. If the RDS Custom for SQL Server DB instance was created with a CEV, then those changes are persisted.
+ Not all options are supported. For example, when you create an RDS Custom for SQL Server DB instance, you can't do the following:
  + Change the number of CPU cores and threads per core on the DB instance class.
  + Turn on storage autoscaling.
  + Specify your own DB parameter group, option group, or character set.
  + Turn on Performance Insights or Database Insights.
  + Turn on automatic minor version upgrade.
+ The maximum DB instance storage is 64 TiB.
+ You can't use RDS Proxy with RDS Custom for SQL Server.
+ You can't use the `describe-reserved-db-instances` API for RDS Custom for SQL Server DB instances.

# Setting character sets and collations for RDS Custom for SQL Server DB instances
<a name="custom-reqs-limits-MS.collation"></a>

## Overview
<a name="custom-reqs-limits-MS.collation.overview"></a>

With RDS Custom for SQL Server DB instances, you can configure the character set and collation settings that determine how data is stored and sorted. Character sets define which characters are allowed, while collations specify the rules for sorting and comparing data. It't important to set the appropriate character sets and collations for applications that work with multilingual data or have specific sorting requirements. For example, you might need to handle accented characters and define language-specific sorting rules, or maintain data integrity across different locales. The following sections provide information on character set and collation support for your RDS Custom for SQL Server DB instances.

RDS Custom for SQL Server supports a wide range of server collations, both in traditional and UTF-8 encoding, for the SQL\$1Latin, Japanese, German, and Arabic locales. The default server collation is `SQL_Latin1_General_CP1_CI_AS`, however, you can select another supported collation to use. You can select a collation using the same procedure that RDS for SQL Server uses. For more information, see [Managing collations and character sets for Amazon RDS for Microsoft SQL Server](Appendix.SQLServer.CommonDBATasks.Collation.md).

## Considerations
<a name="custom-reqs-limits-MS.collation.considerations"></a>

The following requirements and limitations apply when working with server collations on RDS Custom for SQL Server:
+ You can set the server collation when you create an RDS Custom for SQL Server DB instance. You can't modify the server-level collation after the DB instance is created.
+ You can't modify the server level collation when restoring from a DB snapshot or during a point in time recovery (PITR).
+ When you create a DB instance from an RDS Custom for SQL Server CEV, the DB instance doesn't inherit the server collation from the CEV. Instead, the default server collation of `SQL_Latin1_General_CP1_CI_AS` is used. If you've configured a non-default server collation on a RDS Custom for SQL Server CEV and want to use that same server collation on a new DB instance, be sure to select that same collation when you create the DB instance from the CEV.
**Note**  
If the collation you select while creating the DB instance is different from the collation of the CEV, the Microsoft SQL Server system databases on the new RDS Custom for SQL Server DB instance will be rebuilt to use the updated collation. The rebuild process is only performed on the new RDS Custom for SQL Server DB instance and has no impact on the CEV itself. Any previous modifications that you made to the system databases on the CEV will not be retained on the new RDS Custom for SQL Server DB instance once the system databases are rebuilt. Examples of some modifications include user-defined objects in the `master` database, scheduled jobs in the `msdb` database, or changes to default database settings in the `model` database on your CEV. You can manually recreate your modifications once the new RDS Custom for SQL Server DB instance is created. 
+ When you create a DB instance from an RDS Custom for SQL Server custom engine version (CEV) and select a different collation from that of the CEV, ensure that your golden image (AMI) used for CEV creation meets the following requirements so the Microsoft SQL Server system databases on the new DB instance can be rebuilt:
  + For SQL Server 2022, ensure the `setup.exe` file is located in the following path: `C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\SQL2022\setup.exe`
  + For SQL Server 2019, ensure the `setup.exe` file is located in the following path: `C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\SQL2019\setup.exe`
  + Copies of the data and log templates for the `master`, `model`, and `msdb` databases must exist in their default locations. For more information, see [Rebuild system databases](https://learn.microsoft.com/en-us/sql/relational-databases/databases/rebuild-system-databases?view=sql-server-ver16#Restrictions         ) in the Microsoft public documentation.
  + Ensure your SQL Server Database Engine uses `NT Service\MSSQLSERVER `or `NT AUTHORITY\NETWORK SERVICE` as the service account. Any other account will not have the required permissions on the `C:\` drive when configuring a non-default server collation for the DB instance.
+ If the server collation selected for a new DB instance is the same as that configured on your CEV, the Microsoft SQL Server system databases on the new RDS Custom for SQL Server DB instance do not undergo the rebuild process. Any previous modifications that you made to the system databases on the CEV will automatically persist to the new RDS Custom for SQL Server DB instance. 

## Supported collations
<a name="custom-reqs-limits-MS.collation.supportedCollations"></a>

You can set your collation to one of the values listed in the following table.


| Collation | Description | 
| --- |--- |
| Arabic\$1100\$1BIN | Arabic-100, binary sort | 
| Arabic\$1100\$1BIN2 | Arabic-100, binary code point comparison sort | 
| Arabic\$1100\$1CI\$1AI | Arabic-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Arabic\$1100\$1CI\$1AI\$1KS | Arabic-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Arabic\$1100\$1CI\$1AI\$1KS\$1SC | Arabic-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Arabic\$1100\$1CI\$1AI\$1KS\$1SC\$1UTF8 | Arabic-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CI\$1AI\$1KS\$1WS | Arabic-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Arabic\$1100\$1CI\$1AI\$1KS\$1WS\$1SC | Arabic-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Arabic\$1100\$1CI\$1AI\$1KS\$1WS\$1SC\$1UTF8 | Arabic-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CI\$1AI\$1SC | Arabic-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Arabic\$1100\$1CI\$1AI\$1SC\$1UTF8 | Arabic-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CI\$1AI\$1WS | Arabic-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Arabic\$1100\$1CI\$1AI\$1WS\$1SC | Arabic-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Arabic\$1100\$1CI\$1AI\$1WS\$1SC\$1UTF8 | Arabic-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CI\$1AS | Arabic-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Arabic\$1100\$1CI\$1AS\$1KS | Arabic-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Arabic\$1100\$1CI\$1AS\$1KS\$1SC | Arabic-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Arabic\$1100\$1CI\$1AS\$1KS\$1SC\$1UTF8 | Arabic-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CI\$1AS\$1KS\$1WS | Arabic-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Arabic\$1100\$1CI\$1AS\$1KS\$1WS\$1SC | Arabic-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Arabic\$1100\$1CI\$1AS\$1KS\$1WS\$1SC\$1UTF8 | Arabic-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CI\$1AS\$1SC | Arabic-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Arabic\$1100\$1CI\$1AS\$1SC\$1UTF8 | Arabic-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CI\$1AS\$1WS | Arabic-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Arabic\$1100\$1CI\$1AS\$1WS\$1SC | Arabic-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Arabic\$1100\$1CI\$1AS\$1WS\$1SC\$1UTF8 | Arabic-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CS\$1AI | Arabic-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Arabic\$1100\$1CS\$1AI\$1KS | Arabic-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Arabic\$1100\$1CS\$1AI\$1KS\$1SC | Arabic-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Arabic\$1100\$1CS\$1AI\$1KS\$1SC\$1UTF8 | Arabic-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CS\$1AI\$1KS\$1WS | Arabic-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Arabic\$1100\$1CS\$1AI\$1KS\$1WS\$1SC | Arabic-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Arabic\$1100\$1CS\$1AI\$1KS\$1WS\$1SC\$1UTF8 | Arabic-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CS\$1AI\$1SC | Arabic-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Arabic\$1100\$1CS\$1AI\$1SC\$1UTF8 | Arabic-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CS\$1AI\$1WS | Arabic-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Arabic\$1100\$1CS\$1AI\$1WS\$1SC | Arabic-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Arabic\$1100\$1CS\$1AI\$1WS\$1SC\$1UTF8 | Arabic-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CS\$1AS | Arabic-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Arabic\$1100\$1CS\$1AS\$1KS | Arabic-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Arabic\$1100\$1CS\$1AS\$1KS\$1SC | Arabic-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Arabic\$1100\$1CS\$1AS\$1KS\$1SC\$1UTF8 | Arabic-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CS\$1AS\$1KS\$1WS | Arabic-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Arabic\$1100\$1CS\$1AS\$1KS\$1WS\$1SC | Arabic-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Arabic\$1100\$1CS\$1AS\$1KS\$1WS\$1SC\$1UTF8 | Arabic-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CS\$1AS\$1SC | Arabic-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Arabic\$1100\$1CS\$1AS\$1SC\$1UTF8 | Arabic-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Arabic\$1100\$1CS\$1AS\$1WS | Arabic-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Arabic\$1100\$1CS\$1AS\$1WS\$1SC | Arabic-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Arabic\$1100\$1CS\$1AS\$1WS\$1SC\$1UTF8 | Arabic-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Arabic\$1BIN | Arabic, binary sort | 
| Arabic\$1BIN2 | Arabic, binary code point comparison sort | 
| Arabic\$1CI\$1AI | Arabic, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Arabic\$1CI\$1AI\$1KS | Arabic, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Arabic\$1CI\$1AI\$1KS\$1WS | Arabic, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Arabic\$1CI\$1AI\$1WS | Arabic, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Arabic\$1CI\$1AS | Arabic, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Arabic\$1CI\$1AS\$1KS | Arabic, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Arabic\$1CI\$1AS\$1KS\$1WS | Arabic, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Arabic\$1CI\$1AS\$1WS | Arabic, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Arabic\$1CS\$1AI | Arabic, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Arabic\$1CS\$1AI\$1KS | Arabic, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Arabic\$1CS\$1AI\$1KS\$1WS | Arabic, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Arabic\$1CS\$1AI\$1WS | Arabic, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Arabic\$1CS\$1AS | Arabic, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Arabic\$1CS\$1AS\$1KS | Arabic, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Arabic\$1CS\$1AS\$1KS\$1WS | Arabic, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Arabic\$1CS\$1AS\$1WS | Arabic, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Chinese\$1PRC\$1BIN2 | Chinese-PRC, binary code point comparison sort | 
| Chinese\$1PRC\$1CI\$1AS | Chinese-PRC, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Chinese\$1Taiwan\$1Stroke\$1CI\$1AS | Chinese-Taiwan-Stroke, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Danish\$1Norwegian\$1CI\$1AS | Danish-Norwegian, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Finnish\$1Swedish\$1CI\$1AS | Finnish-Swedish, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| French\$1CI\$1AS | French, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1BIN | German-PhoneBook-100, binary sort | 
| German\$1PhoneBook\$1100\$1BIN2 | German-PhoneBook-100, binary code point comparison sort | 
| German\$1PhoneBook\$1100\$1CI\$1AI | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1KS | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1KS\$1SC | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1KS\$1SC\$1UTF8 | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1KS\$1WS | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1KS\$1WS\$1SC | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1KS\$1WS\$1SC\$1UTF8 | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1SC | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1SC\$1UTF8 | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1WS | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1WS\$1SC | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CI\$1AI\$1WS\$1SC\$1UTF8 | German-PhoneBook-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CI\$1AS | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1KS | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1KS\$1SC | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1KS\$1SC\$1UTF8 | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1KS\$1WS | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1KS\$1WS\$1SC | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1KS\$1WS\$1SC\$1UTF8 | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1SC | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1SC\$1UTF8 | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1WS | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1WS\$1SC | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CI\$1AS\$1WS\$1SC\$1UTF8 | German-PhoneBook-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CS\$1AI | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1KS | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1KS\$1SC | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1KS\$1SC\$1UTF8 | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1KS\$1WS | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1KS\$1WS\$1SC | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1KS\$1WS\$1SC\$1UTF8 | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1SC | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1SC\$1UTF8 | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1WS | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1WS\$1SC | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CS\$1AI\$1WS\$1SC\$1UTF8 | German-PhoneBook-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CS\$1AS | German-PhoneBook-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1CS\$1AS\$1KS | German-PhoneBook-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| German\$1PhoneBook\$1100\$1CS\$1AS\$1KS\$1SC | German-PhoneBook-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CS\$1AS\$1KS\$1SC\$1UTF8 | German-PhoneBook-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1100\$1CS\$1AS\$1KS\$1WS | German-PhoneBook-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| German\$1PhoneBook\$1100\$1CS\$1AS\$1KS\$1WS\$1SC | German-PhoneBook-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| German\$1PhoneBook\$1100\$1CS\$1AS\$1KS\$1WS\$1SC\$1UTF8 | German-PhoneBook-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| German\$1PhoneBook\$1BIN | German-PhoneBook, binary sort | 
| German\$1PhoneBook\$1BIN2 | German-PhoneBook, binary code point comparison sort | 
| German\$1PhoneBook\$1CI\$1AI | German-PhoneBook, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1CI\$1AI\$1KS | German-PhoneBook, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| German\$1PhoneBook\$1CI\$1AI\$1KS\$1WS | German-PhoneBook, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| German\$1PhoneBook\$1CI\$1AI\$1WS | German-PhoneBook, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| German\$1PhoneBook\$1CI\$1AS | German-PhoneBook, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1CI\$1AS\$1KS | German-PhoneBook, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| German\$1PhoneBook\$1CI\$1AS\$1KS\$1WS | German-PhoneBook, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| German\$1PhoneBook\$1CI\$1AS\$1WS | German-PhoneBook, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| German\$1PhoneBook\$1CS\$1AI | German-PhoneBook, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1CS\$1AI\$1KS | German-PhoneBook, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| German\$1PhoneBook\$1CS\$1AI\$1KS\$1WS | German-PhoneBook, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| German\$1PhoneBook\$1CS\$1AI\$1WS | German-PhoneBook, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| German\$1PhoneBook\$1CS\$1AS | German-PhoneBook, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| German\$1PhoneBook\$1CS\$1AS\$1KS | German-PhoneBook, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| German\$1PhoneBook\$1CS\$1AS\$1KS\$1WS | German-PhoneBook, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| German\$1PhoneBook\$1CS\$1AS\$1WS | German-PhoneBook, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Hebrew\$1BIN | Hebrew, binary sort | 
| Hebrew\$1CI\$1AS | Hebrew, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$190\$1BIN | Japanese-90, binary sort | 
| Japanese\$190\$1BIN2 | Japanese-90, binary code point comparison sort | 
| Japanese\$190\$1CI\$1AI | Japanese-90, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$190\$1CI\$1AI\$1KS | Japanese-90, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$190\$1CI\$1AI\$1KS\$1SC | Japanese-90, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$190\$1CI\$1AI\$1KS\$1SC\$1UTF8 | Japanese-90, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CI\$1AI\$1KS\$1WS | Japanese-90, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$190\$1CI\$1AI\$1KS\$1WS\$1SC | Japanese-90, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$190\$1CI\$1AI\$1KS\$1WS\$1SC\$1UTF8 | Japanese-90, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CI\$1AI\$1SC | Japanese-90, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$190\$1CI\$1AI\$1SC\$1UTF8 | Japanese-90, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CI\$1AI\$1WS | Japanese-90, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$190\$1CI\$1AI\$1WS\$1SC | Japanese-90, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$190\$1CI\$1AI\$1WS\$1SC\$1UTF8 | Japanese-90, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CI\$1AS | Japanese-90, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$190\$1CI\$1AS\$1KS | Japanese-90, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$190\$1CI\$1AS\$1KS\$1SC | Japanese-90, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$190\$1CI\$1AS\$1KS\$1SC\$1UTF8 | Japanese-90, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CI\$1AS\$1KS\$1WS | Japanese-90, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$190\$1CI\$1AS\$1KS\$1WS\$1SC | Japanese-90, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$190\$1CI\$1AS\$1KS\$1WS\$1SC\$1UTF8 | Japanese-90, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CI\$1AS\$1SC | Japanese-90, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$190\$1CI\$1AS\$1SC\$1UTF8 | Japanese-90, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CI\$1AS\$1WS | Japanese-90, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$190\$1CI\$1AS\$1WS\$1SC | Japanese-90, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$190\$1CI\$1AS\$1WS\$1SC\$1UTF8 | Japanese-90, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CS\$1AI | Japanese-90, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$190\$1CS\$1AI\$1KS | Japanese-90, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$190\$1CS\$1AI\$1KS\$1SC | Japanese-90, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$190\$1CS\$1AI\$1KS\$1SC\$1UTF8 | Japanese-90, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CS\$1AI\$1KS\$1WS | Japanese-90, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$190\$1CS\$1AI\$1KS\$1WS\$1SC | Japanese-90, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$190\$1CS\$1AI\$1KS\$1WS\$1SC\$1UTF8 | Japanese-90, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CS\$1AI\$1SC | Japanese-90, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$190\$1CS\$1AI\$1SC\$1UTF8 | Japanese-90, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CS\$1AI\$1WS | Japanese-90, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$190\$1CS\$1AI\$1WS\$1SC | Japanese-90, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$190\$1CS\$1AI\$1WS\$1SC\$1UTF8 | Japanese-90, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CS\$1AS | Japanese-90, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$190\$1CS\$1AS\$1KS | Japanese-90, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$190\$1CS\$1AS\$1KS\$1SC | Japanese-90, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$190\$1CS\$1AS\$1KS\$1SC\$1UTF8 | Japanese-90, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CS\$1AS\$1KS\$1WS | Japanese-90, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$190\$1CS\$1AS\$1KS\$1WS\$1SC | Japanese-90, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$190\$1CS\$1AS\$1KS\$1WS\$1SC\$1UTF8 | Japanese-90, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CS\$1AS\$1SC | Japanese-90, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$190\$1CS\$1AS\$1SC\$1UTF8 | Japanese-90, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$190\$1CS\$1AS\$1WS | Japanese-90, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$190\$1CS\$1AS\$1WS\$1SC | Japanese-90, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$190\$1CS\$1AS\$1WS\$1SC\$1UTF8 | Japanese-90, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1BIN | Japanese, binary sort | 
| Japanese\$1BIN2 | Japanese, binary code point comparison sort | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1BIN | Japanese-Bushu-Kakusu-100, binary sort | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1BIN2 | Japanese-Bushu-Kakusu-100, binary code point comparison sort | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1KS | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1KS\$1SC | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1KS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1KS\$1WS | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1KS\$1WS\$1SC | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1KS\$1WS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1SC | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1WS | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1WS\$1SC | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AI\$1WS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1KS | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1KS\$1SC | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1KS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1KS\$1WS | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1KS\$1WS\$1SC | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1KS\$1WS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1SC | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1WS | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1WS\$1SC | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CI\$1AS\$1WS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1KS | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1KS\$1SC | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1KS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1KS\$1WS | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1KS\$1WS\$1SC | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1KS\$1WS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1SC | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1WS | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1WS\$1SC | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AI\$1WS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1KS | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1KS\$1SC | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1KS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1KS\$1WS | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1KS\$1WS\$1SC | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1KS\$1WS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1SC | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1WS | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1WS\$1SC | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$1Bushu\$1Kakusu\$1100\$1CS\$1AS\$1WS\$1SC\$1UTF8 | Japanese-Bushu-Kakusu-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1BIN | Japanese-Bushu-Kakusu-140, binary sort | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1BIN2 | Japanese-Bushu-Kakusu-140, binary code point comparison sort | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1KS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1KS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1KS\$1VSS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1KS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1KS\$1WS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1KS\$1WS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplement ary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1KS\$1WS\$1VSS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1KS\$1WS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1VSS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1WS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1WS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1WS\$1VSS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AI\$1WS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1KS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1KS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1KS\$1VSS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1KS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1KS\$1WS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1KS\$1WS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1KS\$1WS\$1VSS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1KS\$1WS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1VSS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1WS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1WS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1WS\$1VSS | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CI\$1AS\$1WS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1KS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1KS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1KS\$1VSS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1KS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1KS\$1WS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1KS\$1WS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1KS\$1WS\$1VSS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1KS\$1WS\$1VSS\$1UTF8 | Japanese-Bushu-Kaku su-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1VSS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1WS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1WS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1WS\$1VSS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AI\$1WS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1KS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1KS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1KS\$1VSS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1KS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1KS\$1WS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1KS\$1WS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1KS\$1WS\$1VSS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1KS\$1WS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1VSS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1WS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1WS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1WS\$1VSS | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1Bushu\$1Kakusu\$1140\$1CS\$1AS\$1WS\$1VSS\$1UTF8 | Japanese-Bushu-Kakusu-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1CI\$1AI | Japanese, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1CI\$1AI\$1KS | Japanese, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1CI\$1AI\$1KS\$1WS | Japanese, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1CI\$1AI\$1WS | Japanese, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1CI\$1AS | Japanese, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1CI\$1AS\$1KS | Japanese, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1CI\$1AS\$1KS\$1WS | Japanese, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1CI\$1AS\$1WS | Japanese, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1CS\$1AI | Japanese, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1CS\$1AI\$1KS | Japanese, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1CS\$1AI\$1KS\$1WS | Japanese, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1CS\$1AI\$1WS | Japanese, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1CS\$1AS | Japanese, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1CS\$1AS\$1KS | Japanese, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1CS\$1AS\$1KS\$1WS | Japanese, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1CS\$1AS\$1WS | Japanese, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1Unicode\$1BIN | Japanese-Unicode, binary sort | 
| Japanese\$1Unicode\$1BIN2 | Japanese-Unicode, binary code point comparison sort | 
| Japanese\$1Unicode\$1CI\$1AI | Japanese-Unicode, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1Unicode\$1CI\$1AI\$1KS | Japanese-Unicode, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1Unicode\$1CI\$1AI\$1KS\$1WS | Japanese-Unicode, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1Unicode\$1CI\$1AI\$1WS | Japanese-Unicode, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1Unicode\$1CI\$1AS | Japanese-Unicode, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1Unicode\$1CI\$1AS\$1KS | Japanese-Unicode, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1Unicode\$1CI\$1AS\$1KS\$1WS | Japanese-Unicode, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1Unicode\$1CI\$1AS\$1WS | Japanese-Unicode, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1Unicode\$1CS\$1AI | Japanese-Unicode, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1Unicode\$1CS\$1AI\$1KS | Japanese-Unicode, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1Unicode\$1CS\$1AI\$1KS\$1WS | Japanese-Unicode, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1Unicode\$1CS\$1AI\$1WS | Japanese-Unicode, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1Unicode\$1CS\$1AS | Japanese-Unicode, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1Unicode\$1CS\$1AS\$1KS | Japanese-Unicode, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1Unicode\$1CS\$1AS\$1KS\$1WS | Japanese-Unicode, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1Unicode\$1CS\$1AS\$1WS | Japanese-Unicode, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1XJIS\$1100\$1BIN | Japanese-XJIS-100, binary sort | 
| Japanese\$1XJIS\$1100\$1BIN2 | Japanese-XJIS-100, binary code point comparison sort | 
| Japanese\$1XJIS\$1100\$1CI\$1AI | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1KS | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1KS\$1SC | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1KS\$1SC\$1UTF8 | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1KS\$1WS | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1KS\$1WS\$1SC | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1KS\$1WS\$1SC\$1UTF8 | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1SC | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1SC\$1UTF8 | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1WS | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1WS\$1SC | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CI\$1AI\$1WS\$1SC\$1UTF8 | Japanese-XJIS-100, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CI\$1AS | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1KS | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1KS\$1SC | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1KS\$1SC\$1UTF8 | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1KS\$1WS | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1KS\$1WS\$1SC | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1KS\$1WS\$1SC\$1UTF8 | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1SC | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1SC\$1UTF8 | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1WS | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1WS\$1SC | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CI\$1AS\$1WS\$1SC\$1UTF8 | Japanese-XJIS-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CS\$1AI | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1KS | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1KS\$1SC | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1KS\$1SC\$1UTF8 | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1KS\$1WS | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1KS\$1WS\$1SC | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1KS\$1WS\$1SC\$1UTF8 | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1SC | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1SC\$1UTF8 | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1WS | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1WS\$1SC | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CS\$1AI\$1WS\$1SC\$1UTF8 | Japanese-XJIS-100, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CS\$1AS | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1KS | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1KS\$1SC | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1KS\$1SC\$1UTF8 | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1KS\$1WS | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1KS\$1WS\$1SC | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1KS\$1WS\$1SC\$1UTF8 | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1SC | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1SC\$1UTF8 | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Japanese\$1XJIS\$1100\$1CS\$1AS\$1WS | Japanese-XJIS-100, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive | 
| Japanese\$1XJIS\$1140\$1BIN | Japanese-XJIS-140, binary sort | 
| Japanese\$1XJIS\$1140\$1BIN2 | Japanese-XJIS-140, binary code point comparison sort | 
| Japanese\$1XJIS\$1140\$1CI\$1AI | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1KS | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1KS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1KS\$1VSS | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1KS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1KS\$1WS | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1KS\$1WS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1KS\$1WS\$1VSS | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1KS\$1WS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1VSS | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1VSS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1WS | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1WS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1WS\$1VSS | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AI\$1WS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AS | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1KS | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1KS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1KS\$1VSS | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1KS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1KS\$1WS | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1KS\$1WS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1KS\$1WS\$1VSS | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1KS\$1WS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1VSS | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1WS | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1WS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1WS\$1VSS | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CI\$1AS\$1WS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-insensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AI | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1KS | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1KS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1KS\$1VSS | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1KS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1KS\$1WS | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1KS\$1WS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1KS\$1WS\$1VSS | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1KS\$1WS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1VSS | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1VSS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1WS | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1WS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1WS\$1VSS | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AI\$1WS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-insensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AS | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1KS | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1KS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1KS\$1VSS | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1KS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1KS\$1WS | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1KS\$1WS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1KS\$1WS\$1VSS | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1KS\$1WS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-sensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1VSS | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1WS | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1WS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector insensitive, UTF8 | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1WS\$1VSS | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive | 
| Japanese\$1XJIS\$1140\$1CS\$1AS\$1WS\$1VSS\$1UTF8 | Japanese-XJIS-140, case-sensitive, accent-sensitive, kanatype-insensitive, width-sensitive, supplementary characters, variation selector sensitive, UTF8 | 
| Korean\$1Wansung\$1CI\$1AS | Korean-Wansung, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Latin1\$1General\$1100\$1BIN | Latin1-General-100, binary sort | 
| Latin1\$1General\$1100\$1BIN2 | Latin1-General-100, binary code point comparison sort | 
| Latin1\$1General\$1100\$1BIN2\$1UTF8 | Latin1-General-100, binary code point comparison sort, UTF8 | 
| Latin1\$1General\$1100\$1CI\$1AS | Latin1-General-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Latin1\$1General\$1100\$1CI\$1AS\$1SC\$1UTF8 | Latin1-General-100, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive, supplementary characters, UTF8 | 
| Latin1\$1General\$1BIN | Latin1-General, binary sort | 
| Latin1\$1General\$1BIN2 | Latin1-General, binary code point comparison sort | 
| Latin1\$1General\$1CI\$1AI | Latin1-General, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive | 
| Latin1\$1General\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Latin1\$1General\$1CI\$1AS\$1KS | Latin1-General, case-insensitive, accent-sensitive, kanatype-sensitive, width-insensitive | 
| Latin1\$1General\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| Modern\$1Spanish\$1CI\$1AS | Modern-Spanish, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 
| SQL\$11xCompat\$1CP850\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 49 on Code Page 850 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1\$1CI\$1AI | Latin1-General, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 54 on Code Page 1252 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 52 on Code Page 1252 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 51 on Code Page 1252 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1250\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 82 on Code Page 1250 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1250\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 81 on Code Page 1250 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1251\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 106 on Code Page 1251 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1251\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 105 on Code Page 1251 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1253\$1CI\$1AI | Latin1-General, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 124 on Code Page 1253 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1253\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 114 on Code Page 1253 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1253\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 113 on Code Page 1253 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1254\$1CI\$1AS | Turkish, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 130 on Code Page 1254 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1254\$1CS\$1AS | Turkish, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 129 on Code Page 1254 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1255\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 138 on Code Page 1255 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1255\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 137 on Code Page 1255 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1256\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 146 on Code Page 1256 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1256\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 145 on Code Page 1256 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1257\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 154 on Code Page 1257 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP1257\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 153 on Code Page 1257 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP437\$1BIN | Latin1-General, binary sort for Unicode Data, SQL Server Sort Order 30 on Code Page 437 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP437\$1BIN2 | Latin1-General, binary code point comparison sort for Unicode Data, SQL Server Sort Order 30 on Code Page 437 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP437\$1CI\$1AI | Latin1-General, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 34 on Code Page 437 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP437\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 32 on Code Page 437 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP437\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 31 on Code Page 437 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP850\$1BIN | Latin1-General, binary sort for Unicode Data, SQL Server Sort Order 40 on Code Page 850 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP850\$1BIN2 | Latin1-General, binary code point comparison sort for Unicode Data, SQL Server Sort Order 40 on Code Page 850 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP850\$1CI\$1AI | Latin1-General, case-insensitive, accent-insensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 44 on Code Page 850 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP850\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 42 on Code Page 850 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1CP850\$1CS\$1AS | Latin1-General, case-sensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 41 on Code Page 850 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1Pref\$1CP1\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 53 on Code Page 1252 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1Pref\$1CP437\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 33 on Code Page 437 for non-Unicode Data | 
| SQL\$1Latin1\$1General\$1Pref\$1CP850\$1CI\$1AS | Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 43 on Code Page 850 for non-Unicode Data | 
| Thai\$1CI\$1AS | Thai, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive | 

# Local time zone for RDS Custom for SQL Server DB instances
<a name="custom-reqs-limits-MS.TimeZone"></a>

The time zone of an RDS Custom for SQL Server DB instance is set by default. The current default is Coordinated Universal Time (UTC). You can set the time zone of your DB instance to a local time zone instead, to match the time zone of your applications.

You set the time zone when you first create your DB instance. You can create your DB instance by using the [AWS Management Console](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html), the Amazon RDS API [CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html.html) action, or the AWS CLI [create-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html) command.

If your DB instance is part of a Multi-AZ deployment, then when you fail over, your time zone remains the local time zone that you set.

When you request a point-in-time restore, you specify the time to restore to. The time is shown in your local time zone. For more information, see [Restoring a DB instance to a specified time for Amazon RDS](USER_PIT.md). 

The following are limitations to setting the local time zone on your DB instance:
+ You can configure the time zone for a DB instance during instance creation, but you can't modify the time zone of an existing RDS Custom for SQL Server DB instance.
+ If the time zone is modified for an existing RDS Custom for SQL Server DB instance, RDS Custom changes the DB instance status to `unsupported-configuration`, and sends event notifications.
+ You can't restore a snapshot from a DB instance in one time zone to a DB instance in a different time zone. 
+ We strongly recommend that you don't restore a backup file from one time zone to a different time zone. If you restore a backup file from one time zone to a different time zone, you must audit your queries and applications for the effects of the time zone change. For more information, see [Importing and exporting SQL Server databases using native backup and restore](SQLServer.Procedural.Importing.md). 

## Supported time zones
<a name="custom-reqs-limits-MS.TimeZone.Zones"></a>

You can set your local time zone to one of the values listed in the following table.


| Time zone | Standard time offset | Description | Notes | 
| --- | --- | --- | --- | 
| Afghanistan Standard Time | (UTC\$104:30) | Kabul | This time zone doesn't observe daylight saving time. | 
| Alaskan Standard Time | (UTC–09:00) | Alaska |  | 
| Aleutian Standard Time | (UTC–10:00) | Aleutian Islands |  | 
| Altai Standard Time | (UTC\$107:00) | Barnaul, Gorno-Altaysk |  | 
| Arab Standard Time | (UTC\$103:00) | Kuwait, Riyadh | This time zone doesn't observe daylight saving time. | 
| Arabian Standard Time | (UTC\$104:00) | Abu Dhabi, Muscat |  | 
| Arabic Standard Time | (UTC\$103:00) | Baghdad | This time zone doesn't observe daylight saving time. | 
| Argentina Standard Time | (UTC–03:00) | City of Buenos Aires | This time zone doesn't observe daylight saving time. | 
| Astrakhan Standard Time | (UTC\$104:00) | Astrakhan, Ulyanovsk |  | 
| Atlantic Standard Time | (UTC–04:00) | Atlantic Time (Canada) |  | 
| AUS Central Standard Time | (UTC\$109:30) | Darwin | This time zone doesn't observe daylight saving time. | 
| Aus Central W. Standard Time | (UTC\$108:45) | Eucla |  | 
| AUS Eastern Standard Time | (UTC\$110:00) | Canberra, Melbourne, Sydney |  | 
| Azerbaijan Standard Time | (UTC\$104:00) | Baku |  | 
| Azores Standard Time | (UTC–01:00) | Azores |  | 
| Bahia Standard Time | (UTC–03:00) | Salvador |  | 
| Bangladesh Standard Time | (UTC\$106:00) | Dhaka | This time zone doesn't observe daylight saving time. | 
| Belarus Standard Time | (UTC\$103:00) | Minsk | This time zone doesn't observe daylight saving time. | 
| Bougainville Standard Time | (UTC\$111:00) | Bougainville Island |  | 
| Canada Central Standard Time | (UTC–06:00) | Saskatchewan | This time zone doesn't observe daylight saving time. | 
| Cape Verde Standard Time | (UTC–01:00) | Cabo Verde Is. | This time zone doesn't observe daylight saving time. | 
| Caucasus Standard Time | (UTC\$104:00) | Yerevan |  | 
| Cen. Australia Standard Time | (UTC\$109:30) | Adelaide |  | 
| Central America Standard Time | (UTC–06:00) | Central America | This time zone doesn't observe daylight saving time. | 
| Central Asia Standard Time | (UTC\$106:00) | Astana | This time zone doesn't observe daylight saving time. | 
| Central Brazilian Standard Time | (UTC–04:00) | Cuiaba |  | 
| Central Europe Standard Time | (UTC\$101:00) | Belgrade, Bratislava, Budapest, Ljubljana, Prague |  | 
| Central European Standard Time | (UTC\$101:00) | Sarajevo, Skopje, Warsaw, Zagreb |  | 
| Central Pacific Standard Time | (UTC\$111:00) | Solomon Islands, New Caledonia | This time zone doesn't observe daylight saving time. | 
| Central Standard Time | (UTC–06:00) | Central Time (US and Canada) |  | 
| Central Standard Time (Mexico) | (UTC–06:00) | Guadalajara, Mexico City, Monterrey |  | 
| Chatham Islands Standard Time | (UTC\$112:45) | Chatham Islands |  | 
| China Standard Time | (UTC\$108:00) | Beijing, Chongqing, Hong Kong, Urumqi | This time zone doesn't observe daylight saving time. | 
| Cuba Standard Time | (UTC–05:00) | Havana |  | 
| Dateline Standard Time | (UTC–12:00) | International Date Line West | This time zone doesn't observe daylight saving time. | 
| E. Africa Standard Time | (UTC\$103:00) | Nairobi | This time zone doesn't observe daylight saving time. | 
| E. Australia Standard Time | (UTC\$110:00) | Brisbane | This time zone doesn't observe daylight saving time. | 
| E. Europe Standard Time | (UTC\$102:00) | Chisinau |  | 
| E. South America Standard Time | (UTC–03:00) | Brasilia |  | 
| Easter Island Standard Time | (UTC–06:00) | Easter Island |  | 
| Eastern Standard Time | (UTC–05:00) | Eastern Time (US and Canada) |  | 
| Eastern Standard Time (Mexico) | (UTC–05:00) | Chetumal |  | 
| Egypt Standard Time | (UTC\$102:00) | Cairo |  | 
| Ekaterinburg Standard Time | (UTC\$105:00) | Ekaterinburg |  | 
| Fiji Standard Time | (UTC\$112:00) | Fiji |  | 
| FLE Standard Time | (UTC\$102:00) | Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius |  | 
| Georgian Standard Time | (UTC\$104:00) | Tbilisi | This time zone doesn't observe daylight saving time. | 
| GMT Standard Time | (UTC) | Dublin, Edinburgh, Lisbon, London |  This time zone isn't the same as Greenwich Mean Time. This time zone does observe daylight saving time. | 
| Greenland Standard Time | (UTC–03:00) | Greenland |  | 
| Greenwich Standard Time | (UTC) | Monrovia, Reykjavik | This time zone doesn't observe daylight saving time. | 
| GTB Standard Time | (UTC\$102:00) | Athens, Bucharest |  | 
| Haiti Standard Time | (UTC–05:00) | Haiti |  | 
| Hawaiian Standard Time | (UTC–10:00) | Hawaii |  | 
| India Standard Time | (UTC\$105:30) | Chennai, Kolkata, Mumbai, New Delhi | This time zone doesn't observe daylight saving time. | 
| Iran Standard Time | (UTC\$103:30) | Tehran |  | 
| Israel Standard Time | (UTC\$102:00) | Jerusalem |  | 
| Jordan Standard Time | (UTC\$102:00) | Amman |  | 
| Kaliningrad Standard Time | (UTC\$102:00) | Kaliningrad |  | 
| Kamchatka Standard Time | (UTC\$112:00) | Petropavlovsk-Kamchatsky – Old |  | 
| Korea Standard Time | (UTC\$109:00) | Seoul | This time zone doesn't observe daylight saving time. | 
| Libya Standard Time | (UTC\$102:00) | Tripoli |  | 
| Line Islands Standard Time | (UTC\$114:00) | Kiritimati Island |  | 
| Lord Howe Standard Time | (UTC\$110:30) | Lord Howe Island |  | 
| Magadan Standard Time | (UTC\$111:00) | Magadan | This time zone doesn't observe daylight saving time. | 
| Magallanes Standard Time | (UTC–03:00) | Punta Arenas |  | 
| Marquesas Standard Time | (UTC–09:30) | Marquesas Islands |  | 
| Mauritius Standard Time | (UTC\$104:00) | Port Louis | This time zone doesn't observe daylight saving time. | 
| Middle East Standard Time | (UTC\$102:00) | Beirut |  | 
| Montevideo Standard Time | (UTC–03:00) | Montevideo |  | 
| Morocco Standard Time | (UTC\$101:00) | Casablanca |  | 
| Mountain Standard Time | (UTC–07:00) | Mountain Time (US and Canada) |  | 
| Mountain Standard Time (Mexico) | (UTC–07:00) | Chihuahua, La Paz, Mazatlan |  | 
| Myanmar Standard Time | (UTC\$106:30) | Yangon (Rangoon) | This time zone doesn't observe daylight saving time. | 
| N. Central Asia Standard Time | (UTC\$107:00) | Novosibirsk |  | 
| Namibia Standard Time | (UTC\$102:00) | Windhoek |  | 
| Nepal Standard Time | (UTC\$105:45) | Kathmandu | This time zone doesn't observe daylight saving time. | 
| New Zealand Standard Time | (UTC\$112:00) | Auckland, Wellington |  | 
| Newfoundland Standard Time | (UTC–03:30) | Newfoundland |  | 
| Norfolk Standard Time | (UTC\$111:00) | Norfolk Island |  | 
| North Asia East Standard Time | (UTC\$108:00) | Irkutsk |  | 
| North Asia Standard Time | (UTC\$107:00) | Krasnoyarsk |  | 
| North Korea Standard Time | (UTC\$109:00) | Pyongyang |  | 
| Omsk Standard Time | (UTC\$106:00) | Omsk |  | 
| Pacific SA Standard Time | (UTC–03:00) | Santiago |  | 
| Pacific Standard Time | (UTC–08:00) | Pacific Time (US and Canada) |  | 
| Pacific Standard Time (Mexico) | (UTC–08:00) | Baja California |  | 
| Pakistan Standard Time | (UTC\$105:00) | Islamabad, Karachi | This time zone doesn't observe daylight saving time. | 
| Paraguay Standard Time | (UTC–04:00) | Asuncion |  | 
| Romance Standard Time | (UTC\$101:00) | Brussels, Copenhagen, Madrid, Paris |  | 
| Russia Time Zone 10 | (UTC\$111:00) | Chokurdakh |  | 
| Russia Time Zone 11 | (UTC\$112:00) | Anadyr, Petropavlovsk-Kamchatsky |  | 
| Russia Time Zone 3 | (UTC\$104:00) | Izhevsk, Samara |  | 
| Russian Standard Time | (UTC\$103:00) | Moscow, St. Petersburg, Volgograd | This time zone doesn't observe daylight saving time. | 
| SA Eastern Standard Time | (UTC–03:00) | Cayenne, Fortaleza | This time zone doesn't observe daylight saving time. | 
| SA Pacific Standard Time | (UTC–05:00) | Bogota, Lima, Quito, Rio Branco |  This time zone doesn't observe daylight saving time. | 
| SA Western Standard Time | (UTC–04:00) | Georgetown, La Paz, Manaus, San Juan | This time zone doesn't observe daylight saving time. | 
| Saint Pierre Standard Time | (UTC–03:00) | Saint Pierre and Miquelon |  | 
| Sakhalin Standard Time | (UTC\$111:00) | Sakhalin |  | 
| Samoa Standard Time | (UTC\$113:00) | Samoa |  | 
| Sao Tome Standard Time | (UTC\$101:00) | Sao Tome |  | 
| Saratov Standard Time | (UTC\$104:00) | Saratov |  | 
| SE Asia Standard Time | (UTC\$107:00) | Bangkok, Hanoi, Jakarta | This time zone doesn't observe daylight saving time. | 
| Singapore Standard Time | (UTC\$108:00) | Kuala Lumpur, Singapore | This time zone doesn't observe daylight saving time. | 
| South Africa Standard Time | (UTC\$102:00) | Harare, Pretoria | This time zone doesn't observe daylight saving time. | 
| Sri Lanka Standard Time | (UTC\$105:30) | Sri Jayawardenepura | This time zone doesn't observe daylight saving time. | 
| Sudan Standard Time | (UTC\$102:00) | Khartoum |  | 
| Syria Standard Time | (UTC\$102:00) | Damascus |  | 
| Taipei Standard Time | (UTC\$108:00) | Taipei | This time zone doesn't observe daylight saving time. | 
| Tasmania Standard Time | (UTC\$110:00) | Hobart |  | 
| Tocantins Standard Time | (UTC–03:00) | Araguaina |  | 
| Tokyo Standard Time | (UTC\$109:00) | Osaka, Sapporo, Tokyo | This time zone doesn't observe daylight saving time. | 
| Tomsk Standard Time | (UTC\$107:00) | Tomsk |  | 
| Tonga Standard Time | (UTC\$113:00) | Nuku'alofa | This time zone doesn't observe daylight saving time. | 
| Transbaikal Standard Time | (UTC\$109:00) | Chita |  | 
| Turkey Standard Time | (UTC\$103:00) | Istanbul |  | 
| Turks And Caicos Standard Time | (UTC–05:00) | Turks and Caicos |  | 
| Ulaanbaatar Standard Time | (UTC\$108:00) | Ulaanbaatar | This time zone doesn't observe daylight saving time. | 
| US Eastern Standard Time | (UTC–05:00) | Indiana (East) |  | 
| US Mountain Standard Time | (UTC–07:00) | Arizona | This time zone doesn't observe daylight saving time. | 
| UTC | UTC | Coordinated Universal Time | This time zone doesn't observe daylight saving time. | 
| UTC–02 | (UTC–02:00) | Coordinated Universal Time–02 | This time zone doesn't observe daylight saving time. | 
| UTC–08 | (UTC–08:00) | Coordinated Universal Time–08 |  | 
| UTC–09 | (UTC–09:00) | Coordinated Universal Time–09 |  | 
| UTC–11 | (UTC–11:00) | Coordinated Universal Time–11 | This time zone doesn't observe daylight saving time. | 
| UTC\$112 | (UTC\$112:00) | Coordinated Universal Time\$112 | This time zone doesn't observe daylight saving time. | 
| UTC\$113 | (UTC\$113:00) | Coordinated Universal Time\$113 |  | 
| Venezuela Standard Time | (UTC–04:00) | Caracas | This time zone doesn't observe daylight saving time. | 
| Vladivostok Standard Time | (UTC\$110:00) | Vladivostok |  | 
| Volgograd Standard Time | (UTC\$104:00) | Volgograd |  | 
| W. Australia Standard Time | (UTC\$108:00) | Perth | This time zone doesn't observe daylight saving time. | 
| W. Central Africa Standard Time | (UTC\$101:00) | West Central Africa | This time zone doesn't observe daylight saving time. | 
| W. Europe Standard Time | (UTC\$101:00) | Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna |  | 
| W. Mongolia Standard Time | (UTC\$107:00) | Hovd |  | 
| West Asia Standard Time | (UTC\$105:00) | Ashgabat, Tashkent | This time zone doesn't observe daylight saving time. | 
| West Bank Standard Time | (UTC\$102:00) | Gaza, Hebron |  | 
| West Pacific Standard Time | (UTC\$110:00) | Guam, Port Moresby | This time zone doesn't observe daylight saving time. | 
| Yakutsk Standard Time | (UTC\$109:00) | Yakutsk |  | 

# Using a Service Master Key with RDS Custom for SQL Server
<a name="custom-sqlserver-features.smk"></a>

RDS Custom for SQL Server supports using a Service Master Key (SMK). RDS Custom retains the same SMK throughout the lifespan of your RDS Custom for SQL Server DB instance. By retaining the same SMK, your DB instance can use objects that are encrypted with the SMK, such as linked server passwords and credentials. If you use a Multi-AZ deployment, RDS Custom also synchronizes and maintains the SMK between primary and secondary DB instances.

**Topics**
+ [

## Region and version availability
](#custom-sqlserver-features.smk.list)
+ [

## Supported features
](#custom-sqlserver-features.smk.supportedfeatures)
+ [

## Using TDE
](#custom-sqlserver-features.smk.tde)
+ [

## Configuring features
](#custom-sqlserver-features.smk.configuringfeatures)
+ [

## Requirements and limitations
](#custom-sqlserver-features.smk.reqlimits)

## Region and version availability
<a name="custom-sqlserver-features.smk.list"></a>

Using an SMK is supported in all Regions where RDS Custom for SQL Server is available, for all SQL Server versions available on RDS Custom. For more information on version and Region availability of Amazon RDS with RDS Custom for SQL Server, see [Supported Regions and DB engines for RDS Custom for SQL Server](Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.md#Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.sq).

## Supported features
<a name="custom-sqlserver-features.smk.supportedfeatures"></a>

When using a SMK with RDS Custom for SQL Server, the following features are supported:
+ Transparent Data Encryption (TDE)
+ Column-level encryption
+ Database Mail
+ Linked Servers
+ SQL Server Integration Services (SSIS)

## Using TDE
<a name="custom-sqlserver-features.smk.tde"></a>

An SMK enables the ability to configure Transparent Data Encryption (TDE), which encrypts data before it is written to storage, and automatically decrypts data when the data is read from storage. Unlike RDS for SQL Server, configuring TDE on an RDS Custom for SQL Server DB instance doesn't require using option groups. Instead, once you've created a certificate and database encryption key, you can run the following command to turn on TDE at the database level:

```
ALTER DATABASE [myDatabase] SET ENCRYPTION ON;
```

 For more information on using TDE with RDS for SQL Server, see [Support for Transparent Data Encryption in SQL Server](Appendix.SQLServer.Options.TDE.md).

 For detailed information on TDE in Microsoft SQL Server, see [Transparent data encryption](https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption?view=sql-server-ver15) in the Microsoft documentation. 

## Configuring features
<a name="custom-sqlserver-features.smk.configuringfeatures"></a>

For detailed steps on configuring features that use a SMK with RDS Custom for SQL Server, you can use the following posts in the Amazon RDS database blog:
+ Linked servers: [Configuring linked servers on RDS Custom for SQL Server](https://aws.amazon.com/blogs/database/configure-linked-servers-on-amazon-rds-custom-for-sql-server/).
+ SSIS: [Migrate SSIS packages to RDS Custom for SQL Server](https://aws.amazon.com/blogs/database/migrate-microsoft-sql-server-ssis-packages-to-amazon-rds-custom-for-sql-server/).
+ TDE: [Secure your data using TDE on RDS Custom for SQL Server](https://aws.amazon.com/blogs/database/secure-your-data-at-rest-on-amazon-rds-custom-for-sql-server-using-transparent-data-encryption-tde-or-column-level-encryption-cle/).

## Requirements and limitations
<a name="custom-sqlserver-features.smk.reqlimits"></a>

When using an SMK with an RDS Custom for SQL Server DB instance, keep in mind the following requirements and limitations:
+ If you re-generate the SMK on your DB instance, you should immediately perform a manual DB snapshot. We recommend avoiding re-generating the SMK if possible.
+ You must maintain backups of the server certificates and database master key passwords. If you don't maintain backups of these, it may result in data loss.
+ If you configure SSIS, you should use an SSM document to join the RDS Custom for SQL Server DB instance to the domain in case of a scale compute or host replacement.
+ When TDE or column-encryption is enabled, database backups are automatically encrypted. When you perform a snapshot restore or point in time recovery, the SMK from the source DB instance will be restored to decrypt data for the restore, and a new SMK will be generated to re-encrypt data on the restored instance.

 For more information on Service Master Keys in Microsoft SQL Server, see [SQL Server and Database Encryption Keys](https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/sql-server-and-database-encryption-keys-database-engine?view=sql-server-ver15) in the Microsoft documentation. 

# Change data capture (CDC) support with RDS Custom for SQL Server
<a name="custom-sqlserver-features.cdc"></a>

## Overview
<a name="custom-sqlserver-features.cdc.overview"></a>

RDS Custom for SQL Server provides native support for Change data capture (CDC), enabling you to track and capture data modifications in your SQL Server tables. CDC stores detailed metadata about these changes for subsequent retrieval and analysis. For detailed information about CDC functionality, see [ Change data capture](https://docs.microsoft.com/en-us/sql/relational-databases/track-changes/track-data-changes-sql-server#Capture) in the Microsoft documentation.

CDC operation in SQL Server requires matching values between the *local server* (that has `server_id` = 0) in `sys.servers` and `SERVERPROPERTY('ServerName')` identifiers. RDS Custom for SQL Server automatically maintains this synchronization throughout the instance's lifecycle to ensuring continuous CDC functioning even if hosts are replaced during maintenance or recovery operations.

**Important**  
Following a Multi-AZ instance failover, the `SERVERPROPERTY('Servername')` function automatically reflects changes in the network/computer name. However, the `@@SERVERNAME` function retains the old server name until the `MSSQLSERVER` service is restarted. Querying @@SERVERNAME returns the previous server name after a failover. To obtain the accurate server name after a failover, use the following SQL query:  

```
SELECT name FROM sys.servers WHERE server_id=0
```
This query provides the most up-to-date server name information without requiring a service restart.

## Region and version availability
<a name="custom-sqlserver-features.cdc.regionAvail"></a>

CDC functionality is supported in all AWS Regions where RDS Custom for SQL Server is available, for all SQL Server versions supported by RDS Custom. For more information about supported versions and Region availability of RDS Custom for SQL Server, see [Supported Regions and DB engines for RDS Custom for SQL Server](Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.md#Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.sq).

## Requirements and limitations
<a name="custom-sqlserver-features.cdc.reqsLims"></a>

When implementing CDC on RDS Custom for SQL Server, be aware the following key considerations:
+ If you manually set `@@SERVERNAME` and/or *local server* in `sys.servers` to use features like MS Replication, if the value of the local server (that has `server_id = 0`) in `sys.servers` is set to a format that matches `*.rds.amazonaws.com` or `*.awsrds.*.com`, RDS Custom for SQL Server does not attempt to modify it to match `SERVERPROPERTY('ServerName')`.
+ RDS cannot modify the local server (that has `server_id = 0`) in `sys.servers` to a new hostname while remote logins or linked servers are actively using the old hostname. This limitation applies in two scenarios:
  + When a linked server establishes a connection to the local server using a remote login associated with the old hostname
  + When an RDS Custom for SQL Server instance acts as a publisher or distributor and has linked logins associated with the old hostname to its subscriber instances.

## Troubleshooting
<a name="custom-sqlserver-features.cdc.Troubleshooting"></a>

To identify remote logins or linked logins associated with the old server name, use the following queries. Validate the results and remove these logins to ensure proper CDC functionality.

```
SELECT * FROM sys.remote_logins WHERE server_id=0
```

or

```
select sss.srvname,ssp.name,srl.remote_name  from sys.server_principals ssp 
inner join sys.remote_logins srl on srl.local_principal_id=ssp.principal_id
inner join sys.sysservers sss  on srl.server_id = sss.srvid
where sss.srvname = @@SERVERNAME
```

# Setting up your environment for Amazon RDS Custom for SQL Server
<a name="custom-setup-sqlserver"></a>

Before you create and manage a DB instance for Amazon RDS Custom for SQL Server DB instance, make sure to perform the following tasks.

**Contents**
+ [

## Prerequisites for setting up RDS Custom for SQL Server
](#custom-setup-sqlserver.review)
  + [

### Automated instance profile creation using the AWS Management Console
](#custom-setup-sqlserver.instanceProfileCreation)
+ [

## Step 1: Grant required permissions to your IAM principal
](#custom-setup-sqlserver.iam-user)
+ [

## Step 2: Configure networking, instance profile, and encryption
](#custom-setup-sqlserver.iam-vpc)
  + [

### Configuring with CloudFormation
](#custom-setup-sqlserver.cf)
    + [

#### Parameters required by CloudFormation
](#custom-setup-sqlserver.cf.params)
    + [

#### Download CloudFormation template file
](#custom-setup-sqlserver.cf.download)
    + [

#### Configuring resources using CloudFormation
](#custom-setup-sqlserver.cf.config)
  + [

### Configuring manually
](#custom-setup-sqlserver.manual)
    + [

#### Make sure that you have a symmetric encryption AWS KMS key
](#custom-setup-sqlserver.cmk)
    + [

#### Creating your IAM role and instance profile manually
](#custom-setup-sqlserver.iam)
      + [

##### Create the AWSRDSCustomSQLServerInstanceRole IAM role
](#custom-setup-sqlserver.iam.create-role)
      + [

##### Add an access policy to AWSRDSCustomSQLServerInstanceRole
](#custom-setup-sqlserver.iam.add-policy)
      + [

##### Create your RDS Custom for SQL Server instance profile
](#custom-setup-sqlserver.iam.create-profile)
      + [

##### Add AWSRDSCustomSQLServerInstanceRole to your RDS Custom for SQL Server instance profile
](#custom-setup-sqlserver.iam.add-profile)
    + [

#### Configuring your VPC manually
](#custom-setup-sqlserver.vpc)
      + [

##### Configure your VPC security group
](#custom-setup-sqlserver.vpc.sg)
      + [

##### Configure endpoints for dependent AWS services
](#custom-setup-sqlserver.vpc.endpoints)
      + [

##### Configure the instance metadata service
](#custom-setup-sqlserver.vpc.imds)
+ [

## Cross-instance restriction
](#custom-setup-sqlserver.cross-instance-restriction)

**Note**  
For a step-by-step tutorial on how to set up prerequisites and launch Amazon RDS Custom for SQL Server, see [Get started with Amazon RDS Custom for SQL Server using an CloudFormation template (Network setup)](https://aws.amazon.com/blogs/database/get-started-with-amazon-rds-custom-for-sql-server-using-an-aws-cloudformation-template-network-setup/) and [ Explore the prerequisites required to create an Amazon RDS Custom for SQL Server instance](https://aws.amazon.com/blogs/database/explore-the-prerequisites-required-to-create-an-amazon-rds-custom-for-sql-server-instance/).

## Prerequisites for setting up RDS Custom for SQL Server
<a name="custom-setup-sqlserver.review"></a>

Before creating an RDS Custom for SQL Server DB instance, make sure that your environment meets the requirements described in this topic. You can also use the CloudFormation template to set up the prerequisites within your AWS account. For more information, see [Configuring with CloudFormation](#custom-setup-sqlserver.cf)

RDS Custom for SQL Server requires that you configure the following prerequisites:
+ Configure the AWS Identity and Access Management (IAM) permissions required for instance creation. This is the AWS Identity and Access Management (IAM) user or role needed to make a `create-db-instance` request to RDS.
+ Configure prerequisite resources required by RDS Custom for SQL Server DB instance:
  + Configure the AWS KMS key required for encryption of RDS Custom instance. RDS Custom requires a customer managed key at the time of instance creation for encryption. The KMS key ARN, ID, alias ARN, or alias name is passed as `kms-key-id` parameter in the request to create the RDS Custom DB instance.
  + Configure the permissions required inside RDS Custom for SQL Server DB instance. RDS Custom attaches an instance profile to DB instance at creation and uses it for automation within the DB instance. The instance profile name is set to `custom-iam-instance-profile` in the RDS Custom create request. You can create an instance profile from the AWS Management Console or manually create your instance profile. For more information, see [Automated instance profile creation using the AWS Management Console](#custom-setup-sqlserver.instanceProfileCreation) and [Creating your IAM role and instance profile manually](#custom-setup-sqlserver.iam).
  + Configure the networking setup as per the requirements of RDS Custom for SQL Server. RDS Custom instances reside in the subnets (configured with DB subnet group) that you provide at instance creation. These subnets must allow RDS Custom instances to communicate with services required for RDS automation.

**Note**  
For the requirements mentioned above, make sure there aren't any service control policies (SCPs) restricting account level permissions.  
If the account that you're using is part of an AWS Organization, it might have service control policies (SCPs) restricting account level permissions. Make sure that the SCPs don't restrict the permissions on users and roles that you create using the following procedures.  
For more information about SCPs, see [Service control policies (SCPs)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html) in the *AWS Organizations User Guide*. Use the [describe-organization](https://docs.aws.amazon.com/cli/latest/reference/organizations/describe-organization.html) AWS CLI command to check whether your account is part of an AWS Organization.  
For more information about AWS Organizations, see [What is AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html) in the *AWS Organizations User Guide*.

For general requirements that apply to RDS Custom for SQL Server, see [General requirements for RDS Custom for SQL Server](custom-reqs-limits-MS.md#custom-reqs-limits.reqsMS).

### Automated instance profile creation using the AWS Management Console
<a name="custom-setup-sqlserver.instanceProfileCreation"></a>

RDS Custom requires you to create and configure an instance profile to launch any RDS Custom for SQL Server DB instance. Use the AWS Management Console to create and attach a new instance profile in a single step. This option is available under RDS Custom security section in the **Create database**, **Restore snapshot**, and **Restore to point in time** console pages. Choose **Create a new instance profile** to provide an instance profile name suffix. The AWS Management Console creates a new instance profile that has the permissions required for RDS Custom automation tasks. To automatically create new instance profiles, your logged-in AWS Management Console user must have `iam:CreateInstanceProfile`, `iam:AddRoleToInstanceProfile`, `iam:CreateRole`, and `iam:AttachRolePolicy` permissions.

**Note**  
This option is only available in the AWS Management Console. If you are using the CLI or SDK, use the RDS Custom provided CloudFormation template or manually create an instance profile. For more information, see [Creating your IAM role and instance profile manually](#custom-setup-sqlserver.iam).

## Step 1: Grant required permissions to your IAM principal
<a name="custom-setup-sqlserver.iam-user"></a>

Make sure that you have sufficient access to create an RDS Custom instance. The IAM role or IAM user (referred to as the *IAM principal*) for creating an RDS Custom for SQL Server DB instance using the console or CLI must have either of the following policies for successful DB instance creation:
+ The `AdministratorAccess` policy
+ The `AmazonRDSFullAccess` policy with the following additional permissions:

  ```
  iam:SimulatePrincipalPolicy
  cloudtrail:CreateTrail
  cloudtrail:StartLogging
  s3:CreateBucket
  s3:PutBucketPolicy
  s3:PutBucketObjectLockConfiguration
  s3:PutBucketVersioning 
  kms:CreateGrant
  kms:DescribeKey
  kms:Decrypt
  kms:ReEncryptFrom
  kms:ReEncryptTo
  kms:GenerateDataKeyWithoutPlaintext
  kms:GenerateDataKey
  ec2:DescribeImages
  ec2:RunInstances
  ec2:CreateTags
  ```

  RDS Custom uses these permissions during instance creation. These permissions configure resources in your account that are required for RDS Custom operations.

  For more information about the `kms:CreateGrant` permission, see [AWS KMS key management](Overview.Encryption.Keys.md).

The following sample JSON policy grants the required permissions.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ValidateIamRole",
            "Effect": "Allow",
            "Action": "iam:SimulatePrincipalPolicy",
            "Resource": "*"
        },
        {
            "Sid": "CreateCloudTrail",
            "Effect": "Allow",
            "Action": [
                "cloudtrail:CreateTrail",
                "cloudtrail:StartLogging"
            ],
            "Resource": "arn:aws:cloudtrail:*:*:trail/do-not-delete-rds-custom-*"
        },
        {
            "Sid": "CreateS3Bucket",
            "Effect": "Allow",
            "Action": [
                "s3:CreateBucket",
                "s3:PutBucketPolicy",
                "s3:PutBucketObjectLockConfiguration",
                "s3:PutBucketVersioning"
            ],
            "Resource": "arn:aws:s3:::do-not-delete-rds-custom-*"
        },
        {
            "Sid": "CreateKmsGrant",
            "Effect": "Allow",
            "Action": [
                "kms:CreateGrant",
                "kms:DescribeKey"
            ],
            "Resource": "*"
        }
    ]
}
```

------

The IAM principal requires the following additional permissions to work with custom engine versions (CEVs):

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ConfigureKmsKeyEncryptionPermission",
            "Effect": "Allow",
            "Action": [
                "kms:CreateGrant",
                "kms:DescribeKey",
                "kms:Decrypt",
                "kms:ReEncryptFrom",
                "kms:ReEncryptTo",
                "kms:GenerateDataKeyWithoutPlaintext",
                "kms:GenerateDataKey"
            ],
            "Resource": "arn:aws:kms:us-east-1:111122223333:key/key_id"
        },
        {
            "Sid": "CreateEc2Instance",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeImages",
                "ec2:RunInstances",
                "ec2:CreateTags"
            ],
            "Resource": "*"
        }
    ]
}
```

------

Replace *111122223333* with the ID of the account that you are using to create your instance. Replace *us-east-1* with the AWS Region you are using to create your instance. Replace *key\$1id* with your customer managed key ID. You can add multiple keys as required. 

For more information about the resource-level permissions that are required to launch an EC2 instance, see [Launch instances (RunInstances)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ExamplePolicies_EC2.html#iam-example-runinstances). 

Also, the IAM principal requires the `iam:PassRole` permission on the IAM role. That must be attached to the instance profile passed in the `custom-iam-instance-profile` parameter in the request to create the RDS Custom DB instance. The instance profile and its attached role are created later in [Step 2: Configure networking, instance profile, and encryption](#custom-setup-sqlserver.iam-vpc).

**Note**  
Make sure that the previously listed permissions aren't restricted by service control policies (SCPs), permission boundaries, or session policies associated with the IAM principal.

## Step 2: Configure networking, instance profile, and encryption
<a name="custom-setup-sqlserver.iam-vpc"></a>

You can configure your IAM instance profile role, virtual private cloud (VPC), and AWS KMS symmetric encryption key by using either of the following processes:
+ [Configuring with CloudFormation](#custom-setup-sqlserver.cf) (recommended)
+ [Configuring manually](#custom-setup-sqlserver.manual)

**Note**  
If your account is part of any AWS Organizations, make sure that the permissions required by the instance profile role aren't restricted by service control policies (SCPs).  
The networking configurations in this topic work best with DB instances that aren't publicly accessible. You can't connect directly to such DB instances from outside the VPC.

### Configuring with CloudFormation
<a name="custom-setup-sqlserver.cf"></a>

To simplify setup, you can use an CloudFormation template file to create a CloudFormation stack. A CloudFormation template creates all the networking, instance profiles, and encryption resources according the requirements of RDS Custom.

To learn how to create stacks, see [Creating a stack on the CloudFormation console](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html) in the *CloudFormation User Guide*.

For a tutorial on how to launch Amazon RDS Custom for SQL Server using an CloudFormation template, see [Get started with Amazon RDS Custom for SQL Server using an CloudFormation template](https://aws.amazon.com/blogs/database/get-started-with-amazon-rds-custom-for-sql-server-using-an-aws-cloudformation-template-network-setup/) in the *AWS Database Blog *.

**Topics**
+ [

#### Parameters required by CloudFormation
](#custom-setup-sqlserver.cf.params)
+ [

#### Download CloudFormation template file
](#custom-setup-sqlserver.cf.download)
+ [

#### Configuring resources using CloudFormation
](#custom-setup-sqlserver.cf.config)

#### Parameters required by CloudFormation
<a name="custom-setup-sqlserver.cf.params"></a>

The following parameters are required to configure RDS Custom prerequisite resources with CloudFormation:

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-sqlserver.html)

#### Resources created by CloudFormation
<a name="custom-setup-sqlserver.cf.list"></a>

Successfully creating the CloudFormation stack using default settings creates the following resources in your AWS account:
+ Symmetric encryption KMS key for encryption of data managed by RDS Custom.
+ The instance profile is is associated to an IAM role with `AmazonRDSCustomInstanceProfileRolePolicy` to provide permissions required by RDS Custom. For more information, see [AmazonRDSCustomServiceRolePolicy](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonRDSCustomServiceRolePolicy.html) in the *AWS Managed Policy Reference Guide*.
+ VPC with the CIDR range specified as the CloudFormation parameter. The default value is `10.0.0.0/16`.
+ Two private subnets with the CIDR range specified in the parameters, and two different Availability Zones in the AWS Region. The default values for the subnet CIDRs are `10.0.128.0/20` and `10.0.144.0/20`.
+ One public subnet with the CIDR range specified in the parameters. The default value for the subnet CIDR is 10.0.0.0/20. The EC2 instance resides in this subnet and can be used to connect to the RDS Custom instance. 
+ DHCP option set for the VPC with domain name resolution to an Amazon Domain Name System (DNS) server.
+ Route table to associate with two private subnets and no access to the internet.
+ Route table to associate with public subnet and has access to the internet.
+ Internet gateway associated with the VPC to allow internet access to public subnet.
+ Network access control list (ACL) to associate with two private subnets and access restricted to HTTPS and DB port within VPC.
+ VPC security group to be associated with the RDS Custom instance. Access is restricted for outbound HTTPS to AWS service endpoints that are required by RDS Custom and inbound DB port from EC2 instance security group.
+ VPC security group to be associated with the EC2 instance in public subnet. Access is restricted for outbound DB port to RDS Custom instance security group.
+ VPC security group to be associated with VPC endpoints that are created for AWS service endpoints that are required by RDS Custom.
+ DB subnet group in which RDS Custom instances are created. Two private subnets created by this template are added to the DB subnet group.
+ VPC endpoints for each of the AWS service endpoints that are required by RDS Custom.

Setting availability configuration to multi-az will create following resources in addition to above list:
+ Network ACL rules allowing communication between private subnets.
+ Inbound and outbound access to Multi-AZ port within VPC security group associated with the RDS Custom instance.
+ VPC endpoints to AWS service endpoint(s) that are required for Multi-AZ communication.

In addition, setting RDP access configuration creates the following resources:
+ Configuring RDP access to public subnet from your source IP address:
  + Network ACL rules that allow RDP connection from your source IP to public subnet.
  + Ingress access to RDP port from your source IP to VPC security group associated with the EC2 instance.
+ Configuring RDP access from EC2 instance in public subnet to RDS Custom Instance in private subnets:
  + Network ACL rules allowing RDP connection from public subnet to private subnets.
  + Inbound access to RDP port from VPC security group associated with the EC2 instance to VPC security group associated with the RDS Custom Instance.

Use the following procedures to create the CloudFormation stack for RDS Custom for SQL Server.

#### Download CloudFormation template file
<a name="custom-setup-sqlserver.cf.download"></a>

**To download the template file**

1. Open the context (right-click) menu for the link [ custom-sqlserver-onboard.zip](samples/custom-sqlserver-onboard.zip) and choose **Save Link As**.

1. Save and extract the file to your computer.

#### Configuring resources using CloudFormation
<a name="custom-setup-sqlserver.cf.config"></a>

**To configure resources using CloudFormation**

1. Open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. To start the Create Stack wizard, choose **Create Stack**.

   The **Create stack** page appears.

1. For **Prerequisite - Prepare template**, choose **Template is ready**.

1. For **Specify template**, do the following:

   1. For **Template source**, choose **Upload a template file**.

   1. For **Choose file**, navigate to and then choose the correct file.

1. Choose **Next**.

   The **Specify stack details** page appears.

1. For **Stack name**, enter **rds-custom-sqlserver**.

1. For **Parameters**, do the following:

   1. To keep the default options, choose **Next**.

   1. To change options, choose the appropriate availability configuration, networking configuration, and RDP access configuration, and then choose **Next**.

      Read the description of each parameter carefully before changing parameters.
**Note**  
If you choose to create at least one Multi-AZ instance in this CloudFormation stack, make sure that the CloudFormation stack parameter **Select an availability configuration for prerequisites setup** is set to `Multi-AZ`. If you create the CloudFormation stack as Single-AZ, update the CloudFormation stack to Multi-AZ configuration before creating the first Multi-AZ instance.

1. On the **Configure stack options page**, choose **Next.**

1. On the **Review rds-custom-sqlserver** page, do the following:

   1. For **Capabilities**, select the ****I acknowledge that CloudFormation might create IAM resources with custom names**** check box.

   1. Choose **Create stack**.

**Note**  
Do not update the resources created from this CloudFormation stack directly from the resource pages. This prevents you from applying future updates to these resources by using a CloudFormation template.

CloudFormation creates the resources that RDS Custom for SQL Server requires. If the stack creation fails, read through the **Events** tab to see which resource creation failed and its status reason.

The **Outputs** tab for this CloudFormation stack in the console should have information about all resources to be passed as parameters for creating an RDS Custom for SQL Server DB instance. Make sure to use the VPC security group and DB subnet group created by CloudFormation for RDS Custom DB instances. By default, RDS tries to attach the default VPC security group, which might not have the access that you need.

If you used CloudFormation to create resources, you can skip [Configuring manually](#custom-setup-sqlserver.manual).

#### Updating the CloudFormation stack
<a name="custom-setup-sqlserver.cf.update"></a>

You can also update some of the configuration on the CloudFormation stack after creation. The configurations that can be updated are:
+ Availability Configuration for RDS Custom for SQL Server
  + **Select an availability configuration for prerequisites setup**: Update this parameter to switch between Single-AZ and Multi-AZ configuration. If you are using this CloudFormation stack for at least one Multi-AZ instance, you must update the stack to choose Multi-AZ configuration.
+ RDP Access Configuration for RDS Custom for SQL Server
  + IPv4 CIDR block of your source: You can update the IPv4 CIDR block (or IP address range) of your source by updating this parameter. Setting this parameter to blank removes RDP access configuration from your source CIDR block to public subnet. 
  + Setup RDP access to RDS Custom for SQL Server: Enable or disable the RDP connection from the EC2 instance to the RDS Custom for SQL Server instance.

#### Deleting the CloudFormation stack
<a name="custom-setup-sqlserver.cf.delete"></a>

You can delete the CloudFormation stack after deleting all the RDS Custom instances that uses resources from the stack. RDS Custom doesn’t keep track of the CloudFormation stack, hence it doesn't block deletion of the stack when there are DB instances that uses stack resources. Make sure that there are no RDS Custom DB instances that uses the stack resources when deleting the stack.

**Note**  
When you delete a CloudFormation stack, all of the resources created by the stack are deleted except the KMS key. The KMS key goes into a pending-deletion state and is deleted after 30 days. To keep the KMS key, perform a [CancelKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_CancelKeyDeletion.html) operation during the 30-day grace period.

### Configuring manually
<a name="custom-setup-sqlserver.manual"></a>

If you choose to configure resources manually, perform the following tasks.

**Note**  
To simplify setup, you can use the CloudFormation template file to create a CloudFormation stack rather than a manual configuration. For more information, see [Configuring with CloudFormation](#custom-setup-sqlserver.cf).  
You can also use the AWS CLI to complete this section. If so, download and install the latest CLI.

**Topics**
+ [

#### Make sure that you have a symmetric encryption AWS KMS key
](#custom-setup-sqlserver.cmk)
+ [

#### Creating your IAM role and instance profile manually
](#custom-setup-sqlserver.iam)
+ [

#### Configuring your VPC manually
](#custom-setup-sqlserver.vpc)

#### Make sure that you have a symmetric encryption AWS KMS key
<a name="custom-setup-sqlserver.cmk"></a>

A symmetric encryption AWS KMS key is required for RDS Custom. When you create an RDS Custom for SQL Server DB instance, make sure to supply the KMS key identifier as parameter `kms-key-id`. For more information, see [Creating and connecting to a DB instance for Amazon RDS Custom for SQL Server](custom-creating-sqlserver.md).

You have the following options:
+ If you have an existing customer managed KMS key in your AWS account, you can use it with RDS Custom. No further action is necessary.
+ If you already created a customer managed symmetric encryption KMS key for a different RDS Custom engine, you can reuse the same KMS key. No further action is necessary.
+ If you don't have an existing customer managed symmetric encryption KMS key in your account, create a KMS key by following the instructions in [Creating keys](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html#create-symmetric-cmk) in the *AWS Key Management Service Developer Guide*.
+ If you're creating a CEV or RDS Custom DB instance, and your KMS key is in a different AWS account, make sure to use the AWS CLI. You can't use the AWS console with cross-account KMS keys.

**Important**  
RDS Custom doesn't support AWS managed KMS keys.

Make sure that your symmetric encryption key grants access to the `kms:Decrypt` and `kms:GenerateDataKey` operations to the AWS Identity and Access Management (IAM) role in your IAM instance profile. If you have a new symmetric encryption key in your account, no changes are required. Otherwise, make sure that your symmetric encryption key's policy grants access to these operations.

For more information, see [Step 4: Configure IAM for RDS Custom for Oracle](custom-setup-orcl.md#custom-setup-orcl.iam-vpc).

#### Creating your IAM role and instance profile manually
<a name="custom-setup-sqlserver.iam"></a>

You can manually create an instance profile and use it to launch RDS Custom instances. If you plan to create the instance in the AWS Management Console, skip this section. The AWS Management Console allows you to create and attach an instance profile to your RDS Custom DB instances. For more information, see [Automated instance profile creation using the AWS Management Console](#custom-setup-sqlserver.instanceProfileCreation). 

When you manually create an instance profile, pass the instance profile name as the `custom-iam-instance-profile` parameter to your `create-db-instance` CLI command. RDS Custom uses the role associated with this instance profile to run automation to manage the instance.

**To create the IAM instance profile and IAM roles for RDS Custom for SQL Server**

1. Create the IAM role named `AWSRDSCustomSQLServerInstanceRole` with a trust policy that lets Amazon EC2 assume this role.

1. Add the AWS Managed Policy `AmazonRDSCustomInstanceProfileRolePolicy` to `AWSRDSCustomSQLServerInstanceRole`.

1. Create an IAM instance profile for RDS Custom for SQL Server that is named `AWSRDSCustomSQLServerInstanceProfile`.

1. Add `AWSRDSCustomSQLServerInstanceRole` to the instance profile.

##### Create the AWSRDSCustomSQLServerInstanceRole IAM role
<a name="custom-setup-sqlserver.iam.create-role"></a>

The following example creates the `AWSRDSCustomSQLServerInstanceRole` role. The trust policy lets Amazon EC2 assume the role.

```
aws iam create-role \
    --role-name AWSRDSCustomSQLServerInstanceRole \
    --assume-role-policy-document '{
        "Version": "2012-10-17",		 	 	 
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Effect": "Allow",
              "Principal": {
                  "Service": "ec2.amazonaws.com"
              }
            }
          ]
        }'
```

##### Add an access policy to AWSRDSCustomSQLServerInstanceRole
<a name="custom-setup-sqlserver.iam.add-policy"></a>

To provide the required permissions, attach the AWS managed policy `AmazonRDSCustomInstanceProfileRolePolicy` to `AWSRDSCustomSQLServerInstanceRole`. `AmazonRDSCustomInstanceProfileRolePolicy` allows RDS Custom instances to send and receive messages, and perform various automation actions.

**Note**  
Make sure that the permissions in the access policy aren't restricted by SCPs or permission boundaries associated with the instance profile role.

The following example attaches AWS managed policy `AmazonRDSCustomInstanceProfileRolePolicy` to the `AWSRDSCustomSQLServerInstanceRole` role.

```
aws iam attach-role-policy \
    --role-name AWSRDSCustomSQLServerInstanceRole \
    --policy-arn arn:aws:iam::aws:policy/AmazonRDSCustomInstanceProfileRolePolicy
```

##### Create your RDS Custom for SQL Server instance profile
<a name="custom-setup-sqlserver.iam.create-profile"></a>

An instance profile is a container that includes a single IAM role. RDS Custom uses the instance profile to pass the role to the instance.

If you use the AWS Management Console to create a role for Amazon EC2, the console automatically creates an instance profile and gives it the same name as the role when the role is created. Create your instance profile as follows, naming it `AWSRDSCustomSQLServerInstanceProfile`.

```
aws iam create-instance-profile \
    --instance-profile-name AWSRDSCustomSQLServerInstanceProfile
```

##### Add AWSRDSCustomSQLServerInstanceRole to your RDS Custom for SQL Server instance profile
<a name="custom-setup-sqlserver.iam.add-profile"></a>

Add the `AWSRDSCustomInstanceRoleForRdsCustomInstance` role to the previously created `AWSRDSCustomSQLServerInstanceProfile` profile.

```
aws iam add-role-to-instance-profile \
    --instance-profile-name AWSRDSCustomSQLServerInstanceProfile \
    --role-name AWSRDSCustomSQLServerInstanceRole
```

#### Configuring your VPC manually
<a name="custom-setup-sqlserver.vpc"></a>

Your RDS Custom DB instance is in a virtual private cloud (VPC) based on the Amazon VPC service, just like an Amazon EC2 instance or Amazon RDS instance. You provide and configure your own VPC. Thus, you have full control over your instance networking setup.

RDS Custom sends communication from your DB instance to other AWS services. Make sure the following services are accessible from the subnet in which you create your RDS Custom DB instances:
+ Amazon CloudWatch (`com.amazonaws.region.monitoring`)
+ Amazon CloudWatch Logs (`com.amazonaws.region.logs`)
+ Amazon CloudWatch Events (`com.amazonaws.region.events`)
+ Amazon EC2 (`com.amazonaws.region.ec2` and `com.amazonaws.region.ec2messages`)
+ Amazon S3 (`com.amazonaws.region.s3`)
+ AWS Secrets Manager (`com.amazonaws.region.secretsmanager`)
+ AWS Systems Manager (`com.amazonaws.region.ssm` and `com.amazonaws.region.ssmmessages`)

If creating Multi-AZ deployments
+ Amazon Simple Queue Service (`com.amazonaws.region.sqs`)

If RDS Custom can't communicate with the necessary services, it publishes the following events:

```
Database instance in incompatible-network. SSM Agent connection not available. Amazon RDS can't connect to the dependent AWS services.
```

```
Database instance in incompatible-network. Amazon RDS can't connect to dependent AWS services. Make sure port 443 (HTTPS) allows outbound connections, and try again. "Failed to connect to the following services: s3 events"
```

To avoid `incompatible-network` errors, make sure that VPC components involved in communication between your RDS Custom DB instance and AWS services satisfy the following requirements:
+ The DB instance can make outbound connections on port 443 to other AWS services.
+ The VPC allows incoming responses to requests originating from your RDS Custom DB instance.
+ RDS Custom can correctly resolve the domain names of endpoints for each AWS service.

If you already configured a VPC for a different RDS Custom DB engine, you can reuse that VPC and skip this process.

**Topics**
+ [

##### Configure your VPC security group
](#custom-setup-sqlserver.vpc.sg)
+ [

##### Configure endpoints for dependent AWS services
](#custom-setup-sqlserver.vpc.endpoints)
+ [

##### Configure the instance metadata service
](#custom-setup-sqlserver.vpc.imds)

##### Configure your VPC security group
<a name="custom-setup-sqlserver.vpc.sg"></a>

A *security group* acts as a virtual firewall for a VPC instance, controlling both inbound and outbound traffic. An RDS Custom DB instance has a security group attached to its network interface that protects the instance. Make sure that your security group permits traffic between RDS Custom and other AWS services through HTTPS. You pass this security group as the `vpc-security-group-ids` parameter in the instance creation request.

**To configure your security group for RDS Custom**

1. Sign in to the AWS Management Console and open the Amazon VPC console at [https://console.aws.amazon.com/vpc](https://console.aws.amazon.com/vpc). 

1. Allow RDS Custom to use the default security group, or create your own security group.

   For detailed instructions, see [Provide access to your DB instance in your VPC by creating a security group](CHAP_SettingUp.md#CHAP_SettingUp.SecurityGroup).

1. Make sure that your security group permits outbound connections on port 443. RDS Custom needs this port to communicate with dependent AWS services.

1. If you have a private VPC and use VPC endpoints, make sure that the security group associated with the DB instance allows outbound connections on port 443 to VPC endpoints. Also make sure that the security group associated with the VPC endpoint allows inbound connections on port 443 from the DB instance.

   If incoming connections aren't allowed, the RDS Custom instance can't connect to the AWS Systems Manager and Amazon EC2 endpoints. For more information, see [Create a Virtual Private Cloud endpoint](https://docs.aws.amazon.com/systems-manager/latest/userguide/setup-create-vpc.html) in the *AWS Systems Manager User Guide*.

1. For RDS Custom for SQL Server Multi-AZ instances, make sure that the security group associated with the DB instance allows inbound and outbound connections on port 1120 to this security group itself. This is required for peer host connection on a Multi-AZ RDS Custom for SQL Server DB instance. 

For more information about security groups, see [Security groups for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) in the *Amazon VPC Developer Guide*.

##### Configure endpoints for dependent AWS services
<a name="custom-setup-sqlserver.vpc.endpoints"></a>

We recommend that you add endpoints for every service to your VPC using the following instructions. However, you can use any solution that lets your VPC communicate with AWS service endpoints. For example, you can use Network Address Translation (NAT) or AWS Direct Connect.

**To configure endpoints for AWS services with which RDS Custom works**

1. Open the Amazon VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. On the navigation bar, use the Region selector to choose the AWS Region.

1. In the navigation pane, choose **Endpoints**. In the main pane, choose **Create Endpoint**.

1. For **Service category**, choose **AWS services**.

1. For **Service Name**, choose the endpoint shown in the table.

1. For **VPC**, choose your VPC.

1. For **Subnets**, choose a subnet from each Availability Zone to include.

   The VPC endpoint can span multiple Availability Zones. AWS creates an elastic network interface for the VPC endpoint in each subnet that you choose. Each network interface has a Domain Name System (DNS) host name and a private IP address.

1. For **Security group**, choose or create a security group.

   You can use security groups to control access to your endpoint, much as you use a firewall. Make sure that the security group allows inbound connections on port 443 from the DB instances. For more information about security groups, see [Security groups for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) in the *Amazon VPC User Guide*. 

1. Optionally, you can attach a policy to the VPC endpoint. Endpoint policies can control access to the AWS service to which you are connecting. The default policy allows all requests to pass through the endpoint. If you're using a custom policy, make sure that requests from the DB instance are allowed in the policy.

1. Choose **Create endpoint**.

The following table explains how to find the list of endpoints that your VPC needs for outbound communications.


| Service | Endpoint format | Notes and links | 
| --- | --- | --- | 
|  AWS Systems Manager  |  Use the following endpoint formats: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-sqlserver.html)  |  For the list of endpoints in each Region, see [AWS Systems Manager endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/ssm.html) in the *Amazon Web Services General Reference*.  | 
|  AWS Secrets Manager  |  Use the endpoint format `secretsmanager.region.amazonaws.com`.  |  For the list of endpoints in each Region, see [AWS Secrets Manager endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/asm.html) in the *Amazon Web Services General Reference*.  | 
|  Amazon CloudWatch  |  Use the following endpoint formats: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-sqlserver.html)  | For the list of endpoints in every Region, see: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-sqlserver.html) | 
|  Amazon EC2  |  Use the following endpoint formats: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-sqlserver.html)  |  For the list of endpoints in each Region, see [Amazon Elastic Compute Cloud endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/ec2-service.html) in the *Amazon Web Services General Reference*.  | 
|  Amazon S3  |  Use the endpoint format `s3.region.amazonaws.com`.  |  For the list of endpoints in each Region, see [Amazon Simple Storage Service endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/s3.html) in the *Amazon Web Services General Reference*.  To learn more about gateway endpoints for Amazon S3, see [Endpoints for Amazon S3](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-s3.html) in the *Amazon VPC Developer Guide*.  To learn how to create an access point, see [Creating access points](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/access-points-create-ap.html) in the *Amazon VPC Developer Guide*. To learn how to create a gateway endpoints for Amazon S3, see [Gateway VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-gateway.html).  | 
|  Amazon Simple Queue Service  | Use the endpoint format sqs.region.amazonaws.com | For the list of endpoints in each Region, see [Amazon Simple Queue Service endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/sqs-service.html). | 

##### Configure the instance metadata service
<a name="custom-setup-sqlserver.vpc.imds"></a>

Make sure that your instance can do the following:
+ Access the instance metadata service using Instance Metadata Service Version 2 (IMDSv2).
+ Allow outbound communications through port 80 (HTTP) to the IMDS link IP address.
+ Request instance metadata from `http://169.254.169.254`, the IMDSv2 link.

For more information, see [Use IMDSv2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html) in the *Amazon EC2 User Guide*.

## Cross-instance restriction
<a name="custom-setup-sqlserver.cross-instance-restriction"></a>

When you create an instance profile by following the steps above, it uses the AWS managed policy `AmazonRDSCustomInstanceProfileRolePolicy` to provide the required permissions to RDS Custom which allows instance management and monitoring automation. The managed policy ensures that the permissions allow access to only those resources which RDS Custom requires to run automation. We recommend using the managed policy to support new features and address security requirements which are automatically applied to existing instance profiles without manual intervention. For more information, see [AWS managed policy: AmazonRDSCustomInstanceProfileRolePolicy](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-security-iam-awsmanpol.html#rds-security-iam-awsmanpol-AmazonRDSCustomInstanceProfileRolePolicy).

The `AmazonRDSCustomInstanceProfileRolePolicy` managed policy restricts the instance profile to have cross-account access but it might allow access to some RDS Custom managed resources across RDS Custom instances within the same account. Based on your requirement, you can use permission boundaries to further restrict cross-instance access. Permission boundaries define the maximum permissions that the identity-based policies can grant to an entity, but doesn't grant permissions by themselves. For more information, see [ Evaluating effective permissions with boundaries](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html#access_policies_boundaries-eval-logic).

For example, the following boundary policy restricts instance profile role to access a specific AWS KMS key and limits access to RDS Custom managed resources across instances which are using different AWS KMS keys.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "DenyOtherKmsKeyAccess",
            "Effect": "Deny",
            "Action": "kms:*",
            "NotResource": "arn:aws:kms:us-east-1:111122223333:key/KMS_key_ID"
        }
    ]
}
```

------

**Note**  
Make sure the permissions boundary does not block any permissions that `AmazonRDSCustomInstanceProfileRolePolicy` grants to RDS Custom.

# Bring Your Own Media with RDS Custom for SQL Server
<a name="custom-sqlserver.byom"></a>

RDS Custom for SQL Server supports two licensing models: License Included (LI) and Bring Your Own Media (BYOM).

**With BYOM, you can do the following:**

1. Provide and install your own Microsoft SQL Server binaries with supported cumulative updates (CU) on an AWS EC2 Windows AMI.

1. Save the AMI as a golden image, which is a template that you can use to create a custom engine version (CEV).

1. Create a CEV from your golden image.

1. Create new RDS Custom for SQL Server DB instances by using your CEV.

Amazon RDS then manages your DB instances for you.

**Note**  
If you also have a License Included (LI) RDS Custom for SQL Server DB instance, you can't use the SQL Server software from this DB instance with BYOM. You must bring your own SQL Server binaries to BYOM.

## Requirements for BYOM for RDS Custom for SQL Server
<a name="custom-sqlserver.byom.requirements"></a>

The same general requirements for custom engine versions with RDS Custom for SQL Server also apply to BYOM. For more information, see [Requirements for RDS Custom for SQL Server CEVs](custom-cev-sqlserver.preparing.md#custom-cev-sqlserver.preparing.Requirements).

When using BYOM, make you sure that you meet the following additional requirements:
+ Use one of the following supported editions: SQL Server 2022 or 2019 Enterprise, Standard, or Developer edition. 
+ Grant the SQL Server sysadmin (SA) server role privilege to `NT AUTHORITY\SYSTEM`.
+ Open TCP port 1433 and UDP port 1434 to allow SSM connections.

## Limitations of BYOM for RDS Custom for SQL Server
<a name="custom-sqlserver.byom.limitations"></a>

The same general limitations for RDS Custom for SQL Server also apply to BYOM. For more information, see [Requirements and limitations for Amazon RDS Custom for SQL Server](custom-reqs-limits-MS.md).

With BYOM, the following additional limitations apply:
+ Only the default SQL Server instance (MSSQLSERVER) is supported. Named SQL Server instances aren't supported. RDS Custom for SQL Server detects and monitors only the default SQL Server instance.
+ Only a single installation of SQL Server is supported on each AMI. Multiple installations of different SQL Server versions aren't supported.
+ SQL Server Web edition isn't supported with BYOM.
+ Evaluation versions of SQL Server editions aren't supported with BYOM. When you install SQL Server, don't select the checkbox for using an evaluation version.
+ Feature availability and support varies across specific versions of each database engine, and across AWS Regions. For more information, see [Region availability for RDS Custom for SQL Server CEVs](custom-cev-sqlserver.preparing.md#custom-cev-sqlserver.preparing.RegionVersionAvailability) and [Version support for RDS Custom for SQL Server CEVs](custom-cev-sqlserver.preparing.md#custom-cev-sqlserver.preparing.VersionSupport). 

## Creating an RDS Custom for SQL Server DB instance with BYOM
<a name="custom-sqlserver.byom.creating"></a>

To prepare and create an RDS Custom for SQL Server DB instance with BYOM, see [Preparing a CEV using Bring Your Own Media (BYOM)](custom-cev-sqlserver.preparing.md#custom-cev-sqlserver.preparing.byom).

# Working with custom engine versions for RDS Custom for SQL Server
<a name="custom-cev-sqlserver"></a>

A *custom engine version (CEV)* for RDS Custom for SQL Server is an Amazon Machine Image (AMI) that includes Microsoft SQL Server.

**The basic steps of the CEV workflow are as follows:**

1. Choose an AWS EC2 Windows AMI to use as a base image for a CEV. You have the option to use pre-installed Microsoft SQL Server, or bring your own media to install SQL Server yourself.

1. Install other software on the operating system (OS) and customize the configuration of the OS and SQL Server to meet your enterprise needs.

1. Save the AMI as a golden image

1. Create a custom engine version (CEV) from your golden image.

1. Create new RDS Custom for SQL Server DB instances by using your CEV.

Amazon RDS then manages these DB instances for you.

A CEV allows you to maintain your preferred baseline configuration of the OS and database. Using a CEV ensures that the host configuration, such as any third-party agent installation or other OS customizations, are persisted on RDS Custom for SQL Server DB instances. With a CEV, you can quickly deploy fleets of RDS Custom for SQL Server DB instances with the same configuration.

**Topics**
+ [

# Preparing to create a CEV for RDS Custom for SQL Server
](custom-cev-sqlserver.preparing.md)
+ [

# Creating a CEV for RDS Custom for SQL Server
](custom-cev-sqlserver.create.md)
+ [

# Modifying a CEV for RDS Custom for SQL Server
](custom-cev-sqlserver-modifying.md)
+ [

# Viewing CEV details for Amazon RDS Custom for SQL Server
](custom-viewing-sqlserver.md)
+ [

# Deleting a CEV for RDS Custom for SQL Server
](custom-cev-sqlserver-deleting.md)

# Preparing to create a CEV for RDS Custom for SQL Server
<a name="custom-cev-sqlserver.preparing"></a>

You can create a CEV using an Amazon Machine Image (AMI) that contains pre-installed, License Included (LI) Microsoft SQL Server, or with an AMI on which you install your own SQL Server installation media (BYOM).

## Preparing a CEV
<a name="custom-cev-sqlserver.preparing.types"></a>

Use the following procedures to create a CEV using Bring Your Own Media (BYOM) or pre-installed Microsoft SQL Server (LI).

### Preparing a CEV using Bring Your Own Media (BYOM)
<a name="custom-cev-sqlserver.preparing.byom"></a>

The following steps use an AMI with **Windows Server 2019 Base** as an example.

**To create a CEV using BYOM**

1. On the Amazon EC2 console, choose **Launch Instance**.

1. For **Name**, enter the name of the instance.

1. Under Quick Start, choose **Windows**.

1. Choose **Microsoft Windows Server 2019 Base**.

1. Choose an appropriate instance type, key pair, network and storage settings, and launch the instance.

1. After launching or creating the EC2 instance, ensure the correct Windows AMI was selected from Step 4:

   1. Select the EC2 instance in the Amazon EC2 console.

   1. In the **Details** section, check the **Usage operation** and ensure that it is set to **RunInstances:0002**.  
![\[Windows AMI using RunInstances:0002 for BYOM.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/cev-sqlserver-byom-ec2runinstances.png)

1. Log in to the EC2 instance and copy your SQL Server installation media to it.
**Note**  
If you're building a CEV using SQL Server Developer edition, you may need to obtain the installation media using your [Microsoft Visual Studio subscription](https://my.visualstudio.com/Downloads?q=sqlserver%20developer).

1. Install SQL Server. Make sure that you do the following:

   1. Review [Requirements for BYOM for RDS Custom for SQL Server](custom-sqlserver.byom.md#custom-sqlserver.byom.requirements) and [Version support for RDS Custom for SQL Server CEVs](#custom-cev-sqlserver.preparing.VersionSupport).

   1. Set the instance root directory to the default `C:\Program Files\Microsoft SQL Server\`. Don't change this directory.

   1. Set the SQL Server Database Engine Account Name to either `NT Service\MSSQLSERVER` or `NT AUTHORITY\NETWORK SERVICE`.

   1. Set the SQL Server Startup mode to **Manual**.

   1. Choose SQL Server Authentication mode as **Mixed**.

   1. Leave the current settings for the default Data directories and TempDB locations.

1. Grant the SQL Server sysadmin (SA) server role privilege to `NT AUTHORITY\SYSTEM`:

   ```
   1. USE [master]
   2. GO
   3. EXEC master..sp_addsrvrolemember @loginame = N'NT AUTHORITY\SYSTEM' , @rolename = N'sysadmin'
   4. GO
   ```

1. Install additional software or customize the OS and database configuration to meet your requirements.

1. Run Sysprep on the EC2 instance. For more information, see [Create an Amazon EC2 AMI using Windows Sysprep](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-create-win-sysprep.html).

1. Save the AMI that contains your installed SQL Server version, other software, and customizations. This will be your golden image.

1. Create a new CEV by providing the AMI ID of the image that you created. For detailed steps, see [Creating a CEV for RDS Custom for SQL Server](custom-cev-sqlserver.create.md).

1. Create a new RDS Custom for SQL Server DB instance using the CEV. For detailed steps, see [Create an RDS Custom for SQL Server DB instance from a CEV](custom-cev-sqlserver.create.md#custom-cev-sqlserver.create.newdbinstance).

### Preparing a CEV using pre-installed SQL Server (LI)
<a name="custom-cev-sqlserver.preparing.licenseincluded"></a>

The following steps to create a CEV using pre-installed Microsoft SQL Server (LI) use an AMI with **SQL Server CU20** Release number `2023.05.10` as an example. When you create a CEV, choose an AMI with the most recent release number. This ensures that you are using a supported version of Windows Server and SQL Server with the latest Cumulative Update (CU).

**To create a CEV using pre-installed Microsoft SQL Server (LI)**

1. Choose the latest available AWS EC2 Windows Amazon Machine Image (AMI) with License Included (LI) Microsoft Windows Server and SQL Server.

   1. Search for **CU20** within the [Windows AMI version history](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-windows-ami-version-history.html).

   1. Note the Release number. For SQL Server 2019 CU20, the release number is `2023.05.10`.  
![\[AMI version history result for SQL Server 2019 CU20.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/rds_custom_sqlserver_cev_find_ami_history_li_cu20.png)

   1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

   1. In the left navigation panel of the Amazon EC2 console choose **Images**, then **AMIs**.

   1. Choose **Public images**.

   1. Enter `2023.05.10` into the search box. A list of AMIs appears.

   1. Enter `Windows_Server-2019-English-Full-SQL_2019` into the search box to filter the results. The following results should appear.  
![\[Supported AMIs using SQL Server 2019 CU20.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/rds_custom_sqlserver_cev_find_ami_li_cu.png)

   1. Choose the AMI with the SQL Server edition that you want to use.

1. Create or launch an EC2 instance from your chosen AMI.

1. Log in to the EC2 instance and install additional software or customize the OS and database configuration to meet your requirements.

1. Run Sysprep on the EC2 instance. For more information prepping an AMI using Sysprep, see [Create a standardized Amazon Machine Image (AMI) using Sysprep](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_EBSbacked_WinAMI.html#sysprep-using-ec2launchv2).

1. Save the AMI that contains your installed SQL Server version, other software, and customizations. This will be your golden image.

1. Create a new CEV by providing the AMI ID of the image that you created. For detailed steps on creating a CEV, see [Creating a CEV for RDS Custom for SQL Server](custom-cev-sqlserver.create.md).

1. Create a new RDS Custom for SQL Server DB instance using the CEV. For detailed steps, see [Create an RDS Custom for SQL Server DB instance from a CEV](custom-cev-sqlserver.create.md#custom-cev-sqlserver.create.newdbinstance).

## Region availability for RDS Custom for SQL Server CEVs
<a name="custom-cev-sqlserver.preparing.RegionVersionAvailability"></a>

Custom engine version (CEV) support for RDS Custom for SQL Server is available in the following AWS Regions:
+ US East (Ohio)
+ US East (N. Virginia)
+ US West (Oregon)
+ US West (N. California)
+ Asia Pacific (Mumbai)
+ Asia Pacific (Osaka)
+ Asia Pacific (Seoul)
+ Asia Pacific (Singapore)
+ Asia Pacific (Sydney)
+ Asia Pacific (Tokyo)
+ Canada (Central)
+ Europe (Frankfurt)
+ Europe (Ireland)
+ Europe (London)
+ Europe (Paris)
+ Europe (Stockholm)
+ South America (São Paulo)

## Version support for RDS Custom for SQL Server CEVs
<a name="custom-cev-sqlserver.preparing.VersionSupport"></a>

CEV creation for RDS Custom for SQL Server is supported for the following AWS EC2 Windows AMIs:
+ For CEVs using pre-installed media, AWS EC2 Windows AMIs with License Included (LI) Microsoft Windows Server 2019 (OS) and SQL Server 2022 or 2019
+ For CEVs using bring your own media (BYOM), AWS EC2 Windows AMIs with Microsoft Windows Server 2019 (OS)

CEV creation for RDS Custom for SQL Server is supported for the following operating system (OS) and database editions:
+ For CEVs using pre-installed media:
  + SQL Server 2022 Enterprise, Standard, or Web, with CU9, CU13, CU14-GDR, CU15-GDR, CU16, CU17, CU18, CU19, CU19-GDR, CU20-GDR, CU21-GDR, CU22 and CU22-GDR.
  + SQL Server 2019 Enterprise, Standard, or Web, with CU8, CU17, CU18, CU20, CU24, CU26, CU28-GDR, CU29-GDR, CU30, CU32, and CU32-GDR.
+ For CEVs using bring your own media (BYOM):
  + SQL Server 2022 Enterprise, Standard, or Developer, with CU9, CU13, CU14-GDR, CU15-GDR, CU16, CU17, CU18, CU19, CU19-GDR, CU20-GDR, CU21-GDR, CU22 and CU22-GDR.
  + SQL Server 2019 Enterprise, Standard, or Developer, with CU8, CU17, CU18, CU20, CU24, CU26, CU28-GDR, CU29-GDR, CU30, CU32, and CU32-GDR.
+ For CEVs using pre-installed media or bring your own media (BYOM), Windows Server 2019 is the only supported OS.

For more information, see [AWS Windows AMI version history](https://docs.aws.amazon.com/ec2/latest/windows-ami-reference/ec2-windows-ami-version-history.html). 

## Requirements for RDS Custom for SQL Server CEVs
<a name="custom-cev-sqlserver.preparing.Requirements"></a>

The following requirements apply to creating a CEV for RDS Custom for SQL Server:
+ The AMI used to create a CEV must be based on an OS and database configuration supported by RDS Custom for SQL Server. For more information on supported configurations, see [Requirements and limitations for Amazon RDS Custom for SQL Server](custom-reqs-limits-MS.md).
+ The CEV must have a unique name. You can't create a CEV with the same name as an existing CEV.
+ You must name the CEV using a naming pattern of SQL Server *major version \$1 minor version \$1 customized string*. The *major version \$1 minor version* must match the SQL Server version provided with the AMI. For example, you can name an AMI with SQL Server 2019 CU17 as **15.00.4249.2.my\$1cevtest**.
+ You must prepare an AMI using Sysprep. For more information about prepping an AMI using Sysprep, see [Create a standardized Amazon Machine Image (AMI) using Sysprep](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-create-win-sysprep.html).
+ You are responsible for maintaining the life cycle of the AMI. An RDS Custom for SQL Server DB instance created from a CEV doesn't store a copy of the AMI. It maintains a pointer to the AMI that you used to create the CEV. The AMI must exist for an RDS Custom for SQL Server DB instance to remain operable.

## Limitations for RDS Custom for SQL Server CEVs
<a name="custom-cev-sqlserver.preparing.Limitations"></a>

The following limitations apply to custom engine versions with RDS Custom for SQL Server:
+ You can't delete a CEV if there are resources, such as DB instances or DB snapshots, associated with it.
+ To create an RDS Custom for SQL Server DB instance, a CEV must have a status of `pending-validation`, `available`, `failed`, or `validating`. You can't create an RDS Custom for SQL Server DB instance using a CEV if the CEV status is `incompatible-image-configuration`.
+ To modify a RDS Custom for SQL Server DB instance to use a new CEV, the CEV must have a status of `available`.
+ You can't create an AMI or CEV from an existing RDS Custom for SQL Server DB instance.
+ You can't modify an existing CEV to use a different AMI. However, you can modify an RDS Custom for SQL Server DB instance to use a different CEV. For more information, see [Modifying an RDS Custom for SQL Server DB instance](custom-managing.modify-sqlserver.md).
+ Encrypting an AMI or CEV with a customer-managed KMS key different than the KMS key provided during DB instance creation is not supported.
+ Cross-Region copy of CEVs isn't supported.
+ Cross-account copy of CEVs isn't supported.
+ You can't restore or recover a CEV after you delete it. However, you can create a new CEV from the same AMI.
+ A RDS Custom for SQL Server DB instance stores your SQL Server database files in the *D:\$1*drive. The AMI associated with a CEV should store the Microsoft SQL Server system database files in the *C:\$1* drive.
+ An RDS Custom for SQL Server DB instance retains your configuration changes made to SQL Server. Any configuration changes to the OS on a running RDS Custom for SQL Server DB instance created from a CEV aren't retained. If you need to make a permanent configuration change to the OS and have it retained as your new baseline configuration, create a new CEV and modify the DB instance to use the new CEV.
**Important**  
Modifying an RDS Custom for SQL Server DB instance to use a new CEV is an offline operation. You can perform the modification immediately or schedule it to occur during a weekly maintenance window.
+ When you modify a CEV, Amazon RDS doesn't push those modifications to any associated RDS Custom for SQL Server DB instances. You must modify each RDS Custom for SQL Server DB instance to use the new or updated CEV. For more information, see [Modifying an RDS Custom for SQL Server DB instance](custom-managing.modify-sqlserver.md).
+ 
**Important**  
If an AMI used by a CEV is deleted, any modifications that may require host replacement, for example, scale compute, will fail. The RDS Custom for SQL Server DB instance will then be placed outside of the RDS support perimeter. We recommend that you avoid deleting any AMI that's associated to a CEV.

# Creating a CEV for RDS Custom for SQL Server
<a name="custom-cev-sqlserver.create"></a>

You can create a custom engine version (CEV) using the AWS Management Console or the AWS CLI. You can then use the CEV to create an RDS Custom for SQL Server DB instance.

Make sure that the Amazon Machine Image (AMI) is in the same AWS account and Region as your CEV. Otherwise, the process to create a CEV fails.

For more information, see [Creating and connecting to a DB instance for Amazon RDS Custom for SQL Server](custom-creating-sqlserver.md).

**Important**  
The steps to create a CEV are the same for AMIs created with pre-installed SQL Server and those created using bring your own media (BYOM).

## Console
<a name="custom-cev-sqlserver.create.console"></a>

**To create a CEV**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Custom engine versions**.

   The **Custom engine versions** page shows all CEVs that currently exist. If you haven't created any CEVs, the table is empty.

1. Choose **Create custom engine version**.

1. For **Engine type**, choose **Microsoft SQL Server**.

1. For **Edition**, choose the DB engine edition that you want to use.

1. For **Major version**, choose the major engine version that's installed on your AMI.

1. In **Version details**, enter a valid name in **Custom engine version name**.

   The name format is `major-engine-version.minor-engine-version.customized_string`. You can use 1–50 alphanumeric characters, underscores, dashes, and periods. For example, you might enter the name **15.00.4249.2.my\$1cevtest**.

   Optionally, enter a description for your CEV.

1. For **Installation Media**, browse to or enter the AMI ID that you'd like to create the CEV from.

1. In the **Tags** section, add any tags to identify the CEV.

1. Choose **Create custom engine version**.

The **Custom engine versions** page appears. Your CEV is shown with the status **pending-validation**

## AWS CLI
<a name="custom-cev-sqlserver.create.CEV"></a>

To create a CEV by using the AWS CLI, run the [create-custom-db-engine-version](https://docs.aws.amazon.com/cli/latest/reference/rds/create-custom-db-engine-version.html) command.

The following options are required:
+ `--engine`
+ `--engine-version`
+ `--image-id`

You can also specify the following options:
+ `--description`
+ `--region`
+ `--tags`

The following example creates a CEV named `15.00.4249.2.my_cevtest`. Make sure that the name of your CEV begins with the major engine version number.

**Example**  
For Linux, macOS, or Unix:  

```
1. aws rds create-custom-db-engine-version \
2.     --engine custom-sqlserver-ee \
3.     --engine-version 15.00.4249.2.my_cevtest \
4.     --image-id ami-0r93cx31t5r596482 \                    
5.     --description "Custom SQL Server EE 15.00.4249.2 cev test"
```
The following partial output shows the engine, parameter groups, and other information.  

```
 1. "DBEngineVersions": [
 2.     {
 3.     "Engine": "custom-sqlserver-ee",
 4.     "MajorEngineVersion": "15.00",
 5.     "EngineVersion": "15.00.4249.2.my_cevtest",
 6.     "DBEngineDescription": "Microsoft SQL Server Enterprise Edition for RDS Custom for SQL Server",
 7.     "DBEngineVersionArn": "arn:aws:rds:us-east-1:<my-account-id>:cev:custom-sqlserver-ee/15.00.4249.2.my_cevtest/a1234a1-123c-12rd-bre1-1234567890",
 8.     "DBEngineVersionDescription": "Custom SQL Server EE 15.00.4249.2 cev test",
 9.                                                       
10.     "Image": [
11.         "ImageId": "ami-0r93cx31t5r596482",
12.         "Status": "pending-validation"
13.      ],
14.     "CreateTime": "2022-11-20T19:30:01.831000+00:00",
15.     "SupportsLogExportsToCloudwatchLogs": false,
16.     "SupportsReadReplica": false,
17.     "Status": "pending-validation",
18.     "SupportsParallelQuery": false,
19.     "SupportsGlobalDatabases": false,
20.     "TagList": []
21.     }
22. ]
```

If the process to create a CEV fails, RDS Custom for SQL Server issues `RDS-EVENT-0198` with the message `Creation failed for custom engine version major-engine-version.cev_name`. The message includes details about the failure, for example, the event prints missing files. To find troubleshooting ideas for CEV creation issues, see [Troubleshooting CEV errors for RDS Custom for SQL Server](custom-troubleshooting-sqlserver.md#custom-troubleshooting-sqlserver.cev).

## Create an RDS Custom for SQL Server DB instance from a CEV
<a name="custom-cev-sqlserver.create.newdbinstance"></a>

After you successfully create a CEV, the **CEV status** shows `pending-validation`. You can now create a new RDS Custom for SQL Server DB instance using the CEV. To create a new RDS Custom for SQL Server DB instance from a CEV, see [Creating an RDS Custom for SQL Server DB instance](custom-creating-sqlserver.md#custom-creating-sqlserver.create).

## Lifecycle of a CEV
<a name="custom-cev-sqlserver.create.lifecycle"></a>

The CEV lifecycle includes the following statuses.


****  

| CEV status | Description | Troubleshooting suggestions | 
| --- | --- | --- | 
| `pending-validation` | A CEV was created and is pending the validation of the associated AMI. A CEV will remain in `pending-validation` until an RDS Custom for SQL Server DB instance is created from it. | If there are no existing tasks, create a new RDS Custom for SQL Server DB instance from the CEV. When creating the RDS Custom for SQL Server DB instance, the system attempts to validate the associated AMI for a CEV.  | 
| `validating` | A creation task for the RDS Custom for SQL Server DB instance based on a new CEV is in progress. When creating the RDS Custom for SQL Server DB instance, the system attempts to validate the associated AMI of a CEV. | Wait for the creation task of the existing RDS Custom for SQL Server DB instance to complete. You can use the RDS EVENTS console to review detailed event messages for troubleshooting.  | 
| `available` | The CEV was successfully validated. A CEV will enter the `available` status once an RDS Custom for SQL Server DB instance has been successfully created from it. | The CEV doesn't require any additional validation. It can be used to create additional RDS Custom for SQL Server DB instances or modify existing ones. | 
| `inactive` | The CEV has been modified to an inactive state. | You can't create or upgrade an RDS Custom DB instance with this CEV. Also, you can't restore a DB snapshot to create a new RDS Custom DB instance with this CEV. For information about how to change the state to `ACTIVE`, see [Modifying a CEV for RDS Custom for SQL Server](custom-cev-sqlserver-modifying.md). | 
| `failed` | The create DB instance step failed for this CEV before it could validate the AMI. Alternatively, the underlying AMI used by the CEV isn't in an available state. | Troubleshoot the root cause for why the system couldn't create the DB instance. View the detailed error message and try to create a new DB instance again. Ensure that the underlying AMI used by the CEV is in an available state. | 
| `incompatible-image-configuration` | There was an error validating the AMI. | View the technical details of the error. You can't attempt to validate the AMI with this CEV again. Review the following: recommendations: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev-sqlserver.create.html) Create a new CEV using the correct information. If needed, create a new EC2 instance using a supported AMI and run the Sysprep process on it.  | 

# Modifying a CEV for RDS Custom for SQL Server
<a name="custom-cev-sqlserver-modifying"></a>

You can modify a CEV using the AWS Management Console or the AWS CLI. You can modify the CEV description or its availability status. Your CEV has one of the following status values:
+ `available` – You can use this CEV to create a new RDS Custom DB instance or upgrade a DB instance. This is the default status for a newly created CEV.
+ `inactive` – You can't create or upgrade an RDS Custom DB instance with this CEV. You can't restore a DB snapshot to create a new RDS Custom DB instance with this CEV.

You can change the CEV status from `available` to `inactive` or from `inactive` to `available`. You might change the status to `INACTIVE` to prevent the accidental use of a CEV or to make a discontinued CEV eligible for use again.

## Console
<a name="custom-cev-sqlserver-modifying.console"></a>

**To modify a CEV**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Custom engine versions**.

1. Choose a CEV whose description or status you want to modify.

1. For **Actions**, choose **Modify**.

1. Make any of the following changes:
   + For **CEV status settings**, choose a new availability status.
   + For **Version description**, enter a new description.

1. Choose **Modify CEV**.

   If the CEV is in use, the console displays **You can't modify the CEV status**. Fix the problems, then try again.

The **Custom engine versions** page appears.

## AWS CLI
<a name="custom-cev-sqlserver-modifying.cli"></a>

To modify a CEV by using the AWS CLI, run the [modify-custom-db-engine-version](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-custom-db-engine-version.html) command. You can find CEVs to modify by running the [describe-db-engine-versions](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-engine-versions.html) command.

The following options are required:
+ `--engine`
+ `--engine-version cev`, where *`cev`* is the name of the custom engine version that you want to modify
+ `--status`` status`, where *`status`* is the availability status that you want to assign to the CEV

The following example changes a CEV named `15.00.4249.2.my_cevtest` from its current status to `inactive`.

**Example**  
For Linux, macOS, or Unix:  

```
1. aws rds modify-custom-db-engine-version \
2.     --engine custom-sqlserver-ee \ 
3.     --engine-version 15.00.4249.2.my_cevtest \
4.     --status inactive
```
For Windows:  

```
1. aws rds modify-custom-db-engine-version ^
2.     --engine custom-sqlserver-ee ^
3.     --engine-version 15.00.4249.2.my_cevtest ^
4.     --status inactive
```

To modify an RDS Custom for SQL Server DB instance to use a new CEV, see [Modifying an RDS Custom for SQL Server DB instance to use a new CEV](custom-cev-sqlserver-modifying-dbinstance.md).

# Modifying an RDS Custom for SQL Server DB instance to use a new CEV
<a name="custom-cev-sqlserver-modifying-dbinstance"></a>

You can modify an existing RDS Custom for SQL Server DB instance to use a different CEV. The changes that you can make include:
+ Changing the CEV
+ Changing the DB instance class
+ Changing the backup retention period and backup window
+ Changing the maintenance window

## Console
<a name="custom-cev-sqlserver-modifying-dbinstance.CON"></a>

**To modify an RDS Custom for SQL Server DB instance**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. Choose the DB instance that you want to modify.

1. Choose **Modify**.

1. Make the following changes as needed:

   1. For **DB engine version**, choose a different CEV.

   1. Change the value for **DB instance class**. For supported classes, see [DB instance class support for RDS Custom for SQL Server](custom-reqs-limits.instancesMS.md).

   1. Change the value for **Backup retention period**.

   1. For **Backup window**, set values for the **Start time** and **Duration**.

   1. For **DB instance maintenance window**, set values for the **Start day**, **Start time**, and **Duration**.

1. Choose **Continue**.

1. Choose **Apply immediately** or **Apply during the next scheduled maintenance window**. 

1. Choose **Modify DB instance**.
**Note**  
When modifying a DB instance from one CEV to an another CEV, for example, when upgrading a minor version, the SQL Server system databases, including their data and configurations, are persisted from the current RDS Custom for SQL Server DB instance.

## AWS CLI
<a name="custom-cev-sqlserver-modifying-dbinstance.CLI"></a>

To modify a DB instance to use a different CEV by using the AWS CLI, run the [modify-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-custom-db-engine-version.html) command.

The following options are required:
+ `--db-instance-identifier`
+ `--engine-version cev`, where *`cev`* is the name of the custom engine version that you want the DB instance to change to.

The following example modifies a DB instance named `my-cev-db-instance` to use a CEV named `15.00.4249.2.my_cevtest_new` and applies the change immediately.

**Example**  
For Linux, macOS, or Unix:  

```
1. aws rds modify-db-instance \
2.     --db-instance-identifier my-cev-db-instance \ 
3.     --engine-version 15.00.4249.2.my_cevtest_new \
4.     --apply-immediately
```
For Windows:  

```
1. aws rds modify-db-instance ^
2.     --db-instance-identifier my-cev-db-instance ^
3.     --engine-version 15.00.4249.2.my_cevtest_new ^
4.     --apply-immediately
```

# Viewing CEV details for Amazon RDS Custom for SQL Server
<a name="custom-viewing-sqlserver"></a>

You can view details about your CEV by using the AWS Management Console or the AWS CLI.

## Console
<a name="custom-viewing-sqlserver.console"></a>

**To view CEV details**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Custom engine versions**.

   The **Custom engine versions** page shows all CEVs that currently exist. If you haven't created any CEVs, the page is empty.

1. Choose the name of the CEV that you want to view.

1. Choose **Configuration** to view the details.  
![\[View the configuration details for a CEV.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/rds_custom_sqlserver_cev_viewdetails.PNG)

## AWS CLI
<a name="custom-viewing-sqlserver.CEV"></a>

To view details about a CEV by using the AWS CLI, run the [describe-db-engine-versions](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-engine-versions.html) command.

You can also specify the following options:
+ `--include-all`, to view all CEVs with any lifecycle state. Without the `--include-all` option, only the CEVs in an `available` lifecycle state will be returned.

```
aws rds describe-db-engine-versions --engine custom-sqlserver-ee --engine-version 15.00.4249.2.my_cevtest --include-all
{
    "DBEngineVersions": [
        {
            "Engine": "custom-sqlserver-ee",
            "MajorEngineVersion": "15.00",
            "EngineVersion": "15.00.4249.2.my_cevtest",
            "DBParameterGroupFamily": "custom-sqlserver-ee-15.0",
            "DBEngineDescription": "Microsoft SQL Server Enterprise Edition for custom RDS",
            "DBEngineVersionArn": "arn:aws:rds:us-east-1:{my-account-id}:cev:custom-sqlserver-ee/15.00.4249.2.my_cevtest/a1234a1-123c-12rd-bre1-1234567890",
            "DBEngineVersionDescription": "Custom SQL Server EE 15.00.4249.2 cev test",
            "Image": {
                "ImageId": "ami-0r93cx31t5r596482",
                "Status": "pending-validation"
            },
            "DBEngineMediaType": "AWS Provided",
            "CreateTime": "2022-11-20T19:30:01.831000+00:00",
            "ValidUpgradeTarget": [],
            "SupportsLogExportsToCloudwatchLogs": false,
            "SupportsReadReplica": false,
            "SupportedFeatureNames": [],
            "Status": "pending-validation",
            "SupportsParallelQuery": false,
            "SupportsGlobalDatabases": false,
            "TagList": [],
            "SupportsBabelfish": false
        }
    ]
}
```

You can use filters to view CEVs with a certain lifecycle status. For example, to view CEVs that have a lifecycle status of either `pending-validation`, `available`, or `failed`:

```
aws rds describe-db-engine-versions engine custom-sqlserver-ee
                region us-west-2 include-all query 'DBEngineVersions[?Status == pending-validation || 
                Status == available || Status == failed]'
```

# Deleting a CEV for RDS Custom for SQL Server
<a name="custom-cev-sqlserver-deleting"></a>

You can delete a CEV using the AWS Management Console or the AWS CLI. Typically, this task takes a few minutes.

Before deleting a CEV, make sure it isn't being used by any of the following:
+ An RDS Custom DB instance
+ A snapshot of an RDS Custom DB instance
+ An automated backup of your RDS Custom DB instance

## Console
<a name="custom-cev-sqlserver-deleting.console"></a>

**To delete a CEV**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Custom engine versions**.

1. Choose a CEV whose description or status you want to delete.

1. For **Actions**, choose **Delete**.

   The **Delete *cev\$1name*?** dialog box appears.

1. Enter **delete me**, and then choose **Delete**.

   In the **Custom engine versions** page, the banner shows that your CEV is being deleted.

## AWS CLI
<a name="custom-cev-sqlserver-deleting.console.cli"></a>

To delete a CEV by using the AWS CLI, run the [delete-custom-db-engine-version](https://docs.aws.amazon.com/cli/latest/reference/rds/delete-custom-db-engine-version.html) command.

The following options are required:
+ `--engine custom-sqlserver-ee`
+ `--engine-version cev`, where *cev* is the name of the custom engine version to be deleted

The following example deletes a CEV named `15.00.4249.2.my_cevtest`.

**Example**  
For Linux, macOS, or Unix:  

```
1. aws rds delete-custom-db-engine-version \
2.     --engine custom-sqlserver-ee \
3.     --engine-version 15.00.4249.2.my_cevtest
```
For Windows:  

```
1. aws rds delete-custom-db-engine-version ^
2.     --engine custom-sqlserver-ee ^
3.     --engine-version 15.00.4249.2.my_cevtest
```

# Creating and connecting to a DB instance for Amazon RDS Custom for SQL Server
<a name="custom-creating-sqlserver"></a>

You can create an RDS Custom DB instance, and then connect to it using AWS Systems Manager or Remote Desktop Protocol (RDP).

**Important**  
Before you can create or connect to an RDS Custom for SQL Server DB instance, make sure to complete the tasks in [Setting up your environment for Amazon RDS Custom for SQL Server](custom-setup-sqlserver.md).  
You can tag RDS Custom DB instances when you create them, but don't create or modify the `AWSRDSCustom` tag that's required for RDS Custom automation. For more information, see [Tagging RDS Custom for SQL Server resources](custom-managing-sqlserver.tagging.md).  
The first time that you create an RDS Custom for SQL Server DB instance, you might receive the following error: The service-linked role is in the process of being created. Try again later. If you do, wait a few minutes and then try again to create the DB instance.

**Topics**
+ [

## Creating an RDS Custom for SQL Server DB instance
](#custom-creating-sqlserver.create)
+ [

# RDS Custom service-linked role
](custom-creating-sqlserver.slr.md)
+ [

# Connecting to your RDS Custom DB instance using AWS Systems Manager
](custom-creating-sqlserver.ssm.md)
+ [

# Connecting to your RDS Custom DB instance using RDP
](custom-creating-sqlserver.rdp.md)

## Creating an RDS Custom for SQL Server DB instance
<a name="custom-creating-sqlserver.create"></a>

Create an Amazon RDS Custom for SQL Server DB instance using either the AWS Management Console or the AWS CLI. The procedure is similar to the procedure for creating an Amazon RDS DB instance.

For more information, see [Creating an Amazon RDS DB instance](USER_CreateDBInstance.md).

### Console
<a name="custom-creating-sqlserver.CON"></a>

**To create an RDS Custom for SQL Server DB instance**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. Choose **Create database**.

1. Choose **Standard create** for the database creation method.

1. For **Engine options**, choose **Microsoft SQL Server** for the engine type.

1. For **Database management type**, choose **Amazon RDS Custom**.

1. In the **Edition** section, choose the DB engine edition that you want to use.

1. (Optional) If you intend to create the DB instance from a CEV, check the **Use custom engine version (CEV)** check box. Select your CEV in the drop-down list.

1. For **Database version**, keep the default value version.

1. For **Templates**, choose **Production**.

1. In the **Settings** section, enter a unique name for the **DB instance identifier**.

1. To enter your master password, do the following:

   1. In the **Settings** section, open **Credential Settings**.

   1. Clear the **Auto generate a password** check box.

   1. Change the **Master username** value and enter the same password in **Master password** and **Confirm password**.

   By default, the new RDS Custom DB instance uses an automatically generated password for the master user.

1. In the **DB instance size** section, choose a value for **DB instance class**.

   For supported classes, see [DB instance class support for RDS Custom for SQL Server](custom-reqs-limits.instancesMS.md).

1. Choose **Storage** settings.

1. For **RDS Custom security**, do the following:

   1. For **IAM instance profile**, you have two options to choose the instance profile for your RDS Custom for SQL Server DB instance.

      1. Choose **Create a new instance profile** and provide an instance profile name suffix. For more information, see [Automated instance profile creation using the AWS Management Console](custom-setup-sqlserver.md#custom-setup-sqlserver.instanceProfileCreation).

      1. Choose an existing instance profile. From the ddropdown list, choose instance profile that begins with `AWSRDSCustom`.

   1. For **Encryption**, choose **Enter a key ARN** to list the available AWS KMS keys. Then choose your key from the list. 

      An AWS KMS key is required for RDS Custom. For more information, see [Make sure that you have a symmetric encryption AWS KMS key](custom-setup-sqlserver.md#custom-setup-sqlserver.cmk).

1. For the remaining sections, specify your preferred RDS Custom DB instance settings. For information about each setting, see [Settings for DB instances](USER_CreateDBInstance.Settings.md). The following settings don't appear in the console and aren't supported:
   + **Processor features**
   + **Storage autoscaling**
   + **Availability & durability**
   + **Password and Kerberos authentication** option in **Database authentication** (only **Password authentication** is supported)
   + **Database options** group in **Additional configuration**
   + **Performance Insights**
   + **Log exports**
   + **Enable auto minor version upgrade**
   + **Deletion protection**

   **Backup retention period** is supported, but you can't choose **0 days**.

1. Choose **Create database**. 

   The **View credential details** button appears on the **Databases** page. 

   To view the master user name and password for the RDS Custom DB instance, choose **View credential details**.

   To connect to the DB instance as the master user, use the user name and password that appear.
**Important**  
You can't view the master user password again. If you don't record it, you might have to change it. To change the master user password after the RDS Custom DB instance is available, modify the DB instance. For more information about modifying a DB instance, see [Managing an Amazon RDS Custom for SQL Server DB instance](custom-managing-sqlserver.md).

1. Choose **Databases** to view the list of RDS Custom DB instances.

1. Choose the RDS Custom DB instance that you just created.

   On the RDS console, the details for the new RDS Custom DB instance appear:
   + The DB instance has a status of **creating** until the RDS Custom DB instance is created and ready for use. When the state changes to **available**, you can connect to the DB instance. Depending on the instance class and storage allocated, it can take several minutes for the new DB instance to be available.
   + **Role** has the value **Instance (RDS Custom)**.
   + **RDS Custom automation mode** has the value **Full automation**. This setting means that the DB instance provides automatic monitoring and instance recovery.

### AWS CLI
<a name="custom-creating-sqlserver.CLI"></a>

You create an RDS Custom DB instance by using the [create-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html) AWS CLI command.

The following options are required:
+ `--db-instance-identifier`
+ `--db-instance-class` (for a list of supported instance classes, see [DB instance class support for RDS Custom for SQL Server](custom-reqs-limits.instancesMS.md))
+ `--engine` (`custom-sqlserver-ee`, `custom-sqlserver-se`, or `custom-sqlserver-web`)
+ `--kms-key-id`
+ `--custom-iam-instance-profile`

The following example creates an RDS Custom for SQL Server DB instance named `my-custom-instance`. The backup retention period is 3 days.

**Note**  
To create a DB instance from a custom engine version (CEV), supply an existing CEV name to the `--engine-version` parameter. For example, `--engine-version 15.00.4249.2.my_cevtest`

**Example**  
For Linux, macOS, or Unix:  

```
 1. aws rds create-db-instance \
 2.     --engine custom-sqlserver-ee \
 3.     --engine-version 15.00.4073.23.v1 \
 4.     --db-instance-identifier my-custom-instance \
 5.     --db-instance-class db.m5.xlarge \
 6.     --allocated-storage 20 \
 7.     --db-subnet-group mydbsubnetgroup \
 8.     --master-username myuser \
 9.     --master-user-password mypassword \
10.     --backup-retention-period 3 \
11.     --no-multi-az \
12.     --port 8200 \
13.     --kms-key-id mykmskey \
14.     --custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance
```
For Windows:  

```
 1. aws rds create-db-instance ^
 2.     --engine custom-sqlserver-ee ^
 3.     --engine-version 15.00.4073.23.v1 ^
 4.     --db-instance-identifier my-custom-instance ^
 5.     --db-instance-class db.m5.xlarge ^
 6.     --allocated-storage 20 ^
 7.     --db-subnet-group mydbsubnetgroup ^
 8.     --master-username myuser ^
 9.     --master-user-password mypassword ^
10.     --backup-retention-period 3 ^
11.     --no-multi-az ^
12.     --port 8200 ^
13.     --kms-key-id mykmskey ^
14.     --custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance
```
Specify a password other than the prompt shown here as a security best practice.

Get details about your instance by using the `describe-db-instances` command.

```
1. aws rds describe-db-instances --db-instance-identifier my-custom-instance
```

The following partial output shows the engine, parameter groups, and other information.

```
 1. {
 2.     "DBInstances": [
 3.         {
 4.             "PendingModifiedValues": {},
 5.             "Engine": "custom-sqlserver-ee",
 6.             "MultiAZ": false,
 7.             "DBSecurityGroups": [],
 8.             "DBParameterGroups": [
 9.                 {
10.                     "DBParameterGroupName": "default.custom-sqlserver-ee-15",
11.                     "ParameterApplyStatus": "in-sync"
12.                 }
13.             ],
14.             "AutomationMode": "full",
15.             "DBInstanceIdentifier": "my-custom-instance",
16.             "TagList": []
17.         }
18.     ]
19. }
```

# RDS Custom service-linked role
<a name="custom-creating-sqlserver.slr"></a>

A *service-linked role* gives Amazon RDS Custom access to resources in your AWS account. It makes using RDS Custom easier because you don't have to manually add the necessary permissions. RDS Custom defines the permissions of its service-linked roles, and unless defined otherwise, only RDS Custom can assume its roles. The defined permissions include the trust policy and the permissions policy, and that permissions policy can't be attached to any other IAM entity.

When you create an RDS Custom DB instance, both the Amazon RDS and RDS Custom service-linked roles are created (if they don't already exist) and used. For more information, see [Using service-linked roles for Amazon RDS](UsingWithRDS.IAM.ServiceLinkedRoles.md).

The first time that you create an RDS Custom for SQL Server DB instance, you might receive the following error: The service-linked role is in the process of being created. Try again later. If you do, wait a few minutes and then try again to create the DB instance.

# Connecting to your RDS Custom DB instance using AWS Systems Manager
<a name="custom-creating-sqlserver.ssm"></a>

After you create your RDS Custom DB instance, you can connect to it using AWS Systems Manager Session Manager. Session Manager is a Systems Manager capability that you can use to manage Amazon EC2 instances through a browser-based shell or through the AWS CLI. For more information, see [AWS Systems Manager Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html).

## Console
<a name="custom-creating-sqlserver.ssm.CON"></a>

**To connect to your DB instance using Session Manager**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**, and then choose the RDS Custom DB instance to which you want to connect.

1. Choose **Configuration**.

1. Note the **Resource ID** value for your DB instance. For example, the resource ID might be `db-ABCDEFGHIJKLMNOPQRS0123456`.

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Look for the name of your EC2 instance, and then choose the instance ID associated with it. For example, the instance ID might be `i-abcdefghijklm01234`.

1. Choose **Connect**.

1. Choose **Session Manager**.

1. Choose **Connect**.

   A window opens for your session.

## AWS CLI
<a name="custom-creating-sqlserver.ssm.CLI"></a>

You can connect to your RDS Custom DB instance using the AWS CLI. This technique requires the Session Manager plugin for the AWS CLI. To learn how to install the plugin, see [Install the Session Manager plugin for the AWS CLI](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html).

To find the DB resource ID of your RDS Custom DB instance, use `[describe-db-instances](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-instances.html)`.

```
aws rds describe-db-instances \
    --query 'DBInstances[*].[DBInstanceIdentifier,DbiResourceId]' \
    --output text
```

The following sample output shows the resource ID for your RDS Custom instance. The prefix is `db-`.

```
db-ABCDEFGHIJKLMNOPQRS0123456
```

To find the EC2 instance ID of your DB instance, use `aws ec2 describe-instances`. The following example uses `db-ABCDEFGHIJKLMNOPQRS0123456` for the resource ID.

```
aws ec2 describe-instances \
    --filters "Name=tag:Name,Values=db-ABCDEFGHIJKLMNOPQRS0123456" \
    --output text \
    --query 'Reservations[*].Instances[*].InstanceId'
```

The following sample output shows the EC2 instance ID.

```
i-abcdefghijklm01234
```

Use the `aws ssm start-session` command, supplying the EC2 instance ID in the `--target` parameter.

```
aws ssm start-session --target "i-abcdefghijklm01234"
```

A successful connection looks like the following.

```
Starting session with SessionId: yourid-abcdefghijklm1234
[ssm-user@ip-123-45-67-89 bin]$
```

# Connecting to your RDS Custom DB instance using RDP
<a name="custom-creating-sqlserver.rdp"></a>

After you create your RDS Custom DB instance, you can connect to this instance using an RDP client. The procedure is the same as for connecting to an Amazon EC2 instance. For more information, see [Connect to your Windows instance](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html).

To connect to the DB instance, you need the key pair associated with the instance. RDS Custom creates the key pair for you. The pair name uses the prefix `do-not-delete-rds-custom-DBInstanceIdentifier`. AWS Secrets Manager stores your private key as a secret.

Complete the task in the following steps:

1. [Configure your DB instance to allow RDP connections](#custom-creating-sqlserver.rdp.port).

1. [Retrieve your secret key](#custom-creating-sqlserver.rdp.key).

1. [Connect to your EC2 instance using the RDP utility](#custom-creating-sqlserver.rdp.connect).

## Configure your DB instance to allow RDP connections
<a name="custom-creating-sqlserver.rdp.port"></a>

To allow RDP connections, configure your VPC security group and set a firewall rule on the host.

### Configure your VPC security group
<a name="custom-creating-sqlserver.rdp.port.vpc"></a>

Make sure that the VPC security group associated with your DB instance permits inbound connections on port 3389 for Transmission Control Protocol (TCP). To learn how to configure your VPC security group, see [Configure your VPC security group](custom-setup-sqlserver.md#custom-setup-sqlserver.vpc.sg).

### Set the firewall rule on the host
<a name="custom-creating-sqlserver.rdp.port.firewall"></a>

To permit inbound connections on port 3389 for TCP, set a firewall rule on the host. The following examples show how to do this.

We recommend that you use the specific `-Profile` value: `Public`, `Private`, or `Domain`. Using `Any` refers to all three values. You can also specify a combination of values separated by a comma. For more information about setting firewall rules, see [Set-NetFirewallRule](https://docs.microsoft.com/en-us/powershell/module/netsecurity/set-netfirewallrule?view=windowsserver2019-ps) in the Microsoft documentation.

**To use Systems Manager Session Manager to set a firewall rule**

1. Connect to Session Manager as shown in [Connecting to your RDS Custom DB instance using AWS Systems Manager](custom-creating-sqlserver.ssm.md).

1. Run the following command.

   ```
   Set-NetFirewallRule -DisplayName "Remote Desktop - User Mode (TCP-In)" -Direction Inbound -LocalAddress Any -Profile Any
   ```

**To use Systems Manager CLI commands to set a firewall rule**

1. Use the following command to open RDP on the host.

   ```
   OPEN_RDP_COMMAND_ID=$(aws ssm send-command --region $AWS_REGION \
       --instance-ids $RDS_CUSTOM_INSTANCE_EC2_ID \
       --document-name "AWS-RunPowerShellScript" \
       --parameters '{"commands":["Set-NetFirewallRule -DisplayName \"Remote Desktop - User Mode (TCP-In)\" -Direction Inbound -LocalAddress Any -Profile Any"]}' \
       --comment "Open RDP port" | jq -r ".Command.CommandId")
   ```

1. Use the command ID returned in the output to get the status of the previous command. To use the following query to return the command ID, make sure that you have the jq plug-in installed.

   ```
   aws ssm list-commands \
       --region $AWS_REGION \
       --command-id $OPEN_RDP_COMMAND_ID
   ```

## Retrieve your secret key
<a name="custom-creating-sqlserver.rdp.key"></a>

Retrieve your secret key using either AWS Management Console or the AWS CLI.

### Console
<a name="custom-creating-sqlserver.rdp.key.CON"></a>

**To retrieve the secret key**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**, and then choose the RDS Custom DB instance to which you want to connect.

1. Choose the **Configuration** tab.

1. Note the **DB instance ID** for your DB instance, for example, `my-custom-instance`.

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Instances**.

1. Look for the name of your EC2 instance, and then choose the instance ID associated with it.

   In this example, the instance ID is `i-abcdefghijklm01234`.

1. In **Details**, find **Key pair name**. The pair name includes the DB identifier. In this example, the pair name is `do-not-delete-rds-custom-my-custom-instance-0d726c`.

1. In the instance summary, find **Public IPv4 DNS**. For the example, the public DNS might be `ec2-12-345-678-901.us-east-2.compute.amazonaws.com`.

1. Open the AWS Secrets Manager console at [https://console.aws.amazon.com/secretsmanager/](https://console.aws.amazon.com/secretsmanager/).

1. Choose the secret that has the same name as your key pair.

1. Choose **Retrieve secret value**.

### AWS CLI
<a name="custom-creating-sqlserver.rdp.key.CLI"></a>

**To retrieve the private key**

1. Get the list of your RDS Custom DB instances by calling the `aws rds describe-db-instances` command.

   ```
   aws rds describe-db-instances \
       --query 'DBInstances[*].[DBInstanceIdentifier,DbiResourceId]' \
       --output text
   ```

1. Choose the DB instance identifier from the sample output, for example `do-not-delete-rds-custom-my-custom-instance`.

1. Find the EC2 instance ID of your DB instance by calling the `aws ec2 describe-instances` command. The following example uses the EC2 instance name to describe the DB instance.

   ```
   aws ec2 describe-instances \
       --filters "Name=tag:Name,Values=do-not-delete-rds-custom-my-custom-instance" \
       --output text \
       --query 'Reservations[*].Instances[*].InstanceId'
   ```

   The following sample output shows the EC2 instance ID.

   ```
   i-abcdefghijklm01234
   ```

1. Find the key name by specifying the EC2 instance ID, as shown in the following example.

   ```
   aws ec2 describe-instances \
       --instance-ids i-abcdefghijklm01234 \
       --output text \
       --query 'Reservations[*].Instances[*].KeyName'
   ```

   The following sample output shows the key name, which uses the prefix `do-not-delete-rds-custom-DBInstanceIdentifier`.

   ```
   do-not-delete-rds-custom-my-custom-instance-0d726c
   ```

## Connect to your EC2 instance using the RDP utility
<a name="custom-creating-sqlserver.rdp.connect"></a>

Follow the procedure in [Connect to your Windows instance using RDP](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html#connect-rdp) in the *Amazon EC2 User Guide*. This procedure assumes that you created a .pem file that contains your private key.

# Managing an Amazon RDS Custom for SQL Server DB instance
<a name="custom-managing-sqlserver"></a>

Amazon RDS Custom for SQL Server supports a subset of the usual management tasks for Amazon RDS DB instances. Following, you can find instructions for the supported RDS Custom for SQL Server management tasks using the AWS Management Console and the AWS CLI.

**Topics**
+ [

# Pausing and resuming RDS Custom automation
](custom-managing-sqlserver.pausing.md)
+ [

# Modifying an RDS Custom for SQL Server DB instance
](custom-managing.modify-sqlserver.md)
+ [

# Modifying the storage for an RDS Custom for SQL Server DB instance
](custom-managing-sqlserver.storage-modify.md)
+ [

# Tagging RDS Custom for SQL Server resources
](custom-managing-sqlserver.tagging.md)
+ [

## Deleting an RDS Custom for SQL Server DB instance
](#custom-managing-sqlserver.deleting)
+ [

# Starting and stopping an RDS Custom for SQL Server DB instance
](custom-managing-sqlserver.startstop.md)

# Pausing and resuming RDS Custom automation
<a name="custom-managing-sqlserver.pausing"></a>

RDS Custom automatically provides monitoring and instance recovery for an RDS Custom for SQL Server DB instance. If you need to customize the instance, do the following:

1. Pause RDS Custom automation for a specified period. The pause ensures that your customizations don't interfere with RDS Custom automation.

1. Customize the RDS Custom for SQL Server DB instance as needed.

1. Do either of the following:
   + Resume automation manually.
   + Wait for the pause period to end. In this case, RDS Custom resumes monitoring and instance recovery automatically.

**Important**  
Pausing and resuming automation are the only supported automation tasks when modifying an RDS Custom for SQL Server DB instance.

## Console
<a name="custom-managing.pausing.console"></a>

**To pause or resume RDS Custom automation**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**, and then choose the RDS Custom DB instance that you want to modify.

1. Choose **Modify**. The **Modify DB instance** page appears.

1. For **RDS Custom automation mode**, choose one of the following options:
   + **Paused** pauses the monitoring and instance recovery for the RDS Custom DB instance. Enter the pause duration that you want (in minutes) for **Automation mode duration**. The minimum value is 60 minutes (default). The maximum value is 1,440 minutes.
   + **Full automation** resumes automation.

1. Choose **Continue** to check the summary of modifications.

   A message indicates that RDS Custom will apply the changes immediately.

1. If your changes are correct, choose **Modify DB instance**. Or choose **Back** to edit your changes or **Cancel** to cancel your changes.

   On the RDS console, the details for the modification appear. If you paused automation, the **Status** of your RDS Custom DB instance indicates **Automation paused**.

1. (Optional) In the navigation pane, choose **Databases**, and then your RDS Custom DB instance.

   In the **Summary** pane, **RDS Custom automation mode** indicates the automation status. If automation is paused, the value is **Paused. Automation resumes in *num* minutes**.

## AWS CLI
<a name="custom-managing-sqlserver.pausing.CLI"></a>

To pause or resume RDS Custom automation, use the `modify-db-instance` AWS CLI command. Identify the DB instance using the required parameter `--db-instance-identifier`. Control the automation mode with the following parameters:
+ `--automation-mode` specifies the pause state of the DB instance. Valid values are `all-paused`, which pauses automation, and `full`, which resumes it.
+ `--resume-full-automation-mode-minutes` specifies the duration of the pause. The default value is 60 minutes.

**Note**  
Regardless of whether you specify `--no-apply-immediately` or `--apply-immediately`, RDS Custom applies modifications asynchronously as soon as possible.

In the command response, `ResumeFullAutomationModeTime` indicates the resume time as a UTC timestamp. When the automation mode is `all-paused`, you can use `modify-db-instance` to resume automation mode or extend the pause period. No other `modify-db-instance` options are supported.

The following example pauses automation for `my-custom-instance` for 90 minutes.

**Example**  
For Linux, macOS, or Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --automation-mode all-paused \
    --resume-full-automation-mode-minutes 90
```
For Windows:  

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --automation-mode all-paused ^
    --resume-full-automation-mode-minutes 90
```

The following example extends the pause duration for an extra 30 minutes. The 30 minutes is added to the original time shown in `ResumeFullAutomationModeTime`.

**Example**  
For Linux, macOS, or Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --automation-mode all-paused \
    --resume-full-automation-mode-minutes 30
```
For Windows:  

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --automation-mode all-paused ^
    --resume-full-automation-mode-minutes 30
```

The following example resumes full automation for `my-custom-instance`.

**Example**  
For Linux, macOS, or Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --automation-mode full \
```
For Windows:  

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --automation-mode full
```
In the following partial sample output, the pending `AutomationMode` value is `full`.  

```
{
    "DBInstance": {
        "PubliclyAccessible": true,
        "MasterUsername": "admin",
        "MonitoringInterval": 0,
        "LicenseModel": "bring-your-own-license",
        "VpcSecurityGroups": [
            {
                "Status": "active",
                "VpcSecurityGroupId": "0123456789abcdefg"
            }
        ],
        "InstanceCreateTime": "2020-11-07T19:50:06.193Z",
        "CopyTagsToSnapshot": false,
        "OptionGroupMemberships": [
            {
                "Status": "in-sync",
                "OptionGroupName": "default:custom-oracle-ee-19"
            }
        ],
        "PendingModifiedValues": {
            "AutomationMode": "full"
        },
        "Engine": "custom-oracle-ee",
        "MultiAZ": false,
        "DBSecurityGroups": [],
        "DBParameterGroups": [
            {
                "DBParameterGroupName": "default.custom-oracle-ee-19",
                "ParameterApplyStatus": "in-sync"
            }
        ],
        ...
        "ReadReplicaDBInstanceIdentifiers": [],
        "AllocatedStorage": 250,
        "DBInstanceArn": "arn:aws:rds:us-west-2:012345678912:db:my-custom-instance",
        "BackupRetentionPeriod": 3,
        "DBName": "ORCL",
        "PreferredMaintenanceWindow": "fri:10:56-fri:11:26",
        "Endpoint": {
            "HostedZoneId": "ABCDEFGHIJKLMNO",
            "Port": 8200,
            "Address": "my-custom-instance.abcdefghijk.us-west-2.rds.amazonaws.com"
        },
        "DBInstanceStatus": "automation-paused",
        "IAMDatabaseAuthenticationEnabled": false,
        "AutomationMode": "all-paused",
        "EngineVersion": "19.my_cev1",
        "DeletionProtection": false,
        "AvailabilityZone": "us-west-2a",
        "DomainMemberships": [],
        "StorageType": "gp2",
        "DbiResourceId": "db-ABCDEFGHIJKLMNOPQRSTUVW",
        "ResumeFullAutomationModeTime": "2020-11-07T20:56:50.565Z",
        "KmsKeyId": "arn:aws:kms:us-west-2:012345678912:key/aa111a11-111a-11a1-1a11-1111a11a1a1a",
        "StorageEncrypted": false,
        "AssociatedRoles": [],
        "DBInstanceClass": "db.m5.xlarge",
        "DbInstancePort": 0,
        "DBInstanceIdentifier": "my-custom-instance",
        "TagList": []
    }
```

# Modifying an RDS Custom for SQL Server DB instance
<a name="custom-managing.modify-sqlserver"></a>

Modifying an RDS Custom for SQL Server DB instance is similar to doing this for Amazon RDS, but the changes that you can make are limited to the following:
+ Changing the DB instance class
+ Changing the backup retention period and backup window
+ Changing the maintenance window
+ Upgrading the DB engine version when a new version becomes available
+ Changing the allocated storage, provisioned IOPS, and storage type
+ Allowing and removing Multi-AZ deployments

The following limitations apply to modifying an RDS Custom for SQL Server DB instance:
+ Custom DB option and parameter groups aren't supported.
+ Any storage volumes that you attach manually to your RDS Custom DB instance are outside the support perimeter.

  For more information, see [RDS Custom support perimeter](custom-concept.md#custom-troubleshooting.support-perimeter).

## Console
<a name="custom-managing.modify-sqlserver.CON"></a>

**To modify an RDS Custom for SQL Server DB instance**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. Choose the DB instance that you want to modify.

1. Choose **Modify**.

1. Make the following changes as needed:

   1. For **DB engine version**, choose the new version.

   1. Change the value for **DB instance class**. For supported classes, see [DB instance class support for RDS Custom for SQL Server](custom-reqs-limits.instancesMS.md)

   1. Change the value for **Backup retention period**.

   1. For **Backup window**, set values for the **Start time** and **Duration**.

   1. For **DB instance maintenance window**, set values for the **Start day**, **Start time**, and **Duration**.

1. Choose **Continue**.

1. Choose **Apply immediately** or **Apply during the next scheduled maintenance window**.

1. Choose **Modify DB instance**.

## AWS CLI
<a name="custom-managing.modify-sqlserver.CLI"></a>

To modify an RDS Custom for SQL Server DB instance, use the [modify-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) AWS CLI command. Set the following parameters as needed:
+ `--db-instance-class` – For supported classes, see [DB instance class support for RDS Custom for SQL Server](custom-reqs-limits.instancesMS.md)
+ `--engine-version` – The version number of the database engine to which you're upgrading.
+ `--backup-retention-period` – How long to retain automated backups, from 0–35 days.
+ `--preferred-backup-window` – The daily time range during which automated backups are created.
+ `--preferred-maintenance-window` – The weekly time range (in UTC) during which system maintenance can occur.
+ `--apply-immediately` – Use `--apply-immediately` to apply the storage changes immediately.

  Or use `--no-apply-immediately` (the default) to apply the changes during the next maintenance window.

# Modifying the storage for an RDS Custom for SQL Server DB instance
<a name="custom-managing-sqlserver.storage-modify"></a>

Modifying storage for an RDS Custom for SQL Server DB instance is similar to modifying storage for an Amazon RDS DB instance, but you can only do the following:
+ Increase the allocated storage size.
+ Change the storage type. You can use available storage types such as General Purpose or Provisioned IOPS. Provisioned IOPS is supported for the gp3, io1, and io2 Block Express storage types.
+ Change the provisioned IOPS, if you're using the volume types that support Provisioned IOPS.

The following limitations apply to modifying the storage for an RDS Custom for SQL Server DB instance:
+ The minimum allocated storage size for RDS Custom for SQL Server is 20 GiB. The maximum storage limit for io1, gp2, and gp3 is 16 TiB while io2 supports 64 TiB.
+ As with Amazon RDS, you can't decrease the allocated storage. This is a limitation of Amazon Elastic Block Store (Amazon EBS) volumes. For more information, see [Working with storage for Amazon RDS DB instances](USER_PIOPS.StorageTypes.md)
+ Storage autoscaling isn't supported for RDS Custom for SQL Server DB instances.
+ Any storage volumes that you manually attach to your RDS Custom DB instance are not considered for storage scaling. Only the RDS-provided default data volumes, i.e., the D drive, are considered for storage scaling.

  For more information, see [RDS Custom support perimeter](custom-concept.md#custom-troubleshooting.support-perimeter).
+ Scaling storage usually doesn't cause any outage or performance degradation of the DB instance. After you modify the storage size for a DB instance, the status of the DB instance is **storage-optimization**.
+ Storage optimization can take several hours. You can't make further storage modifications for either six (6) hours or until storage optimization has completed on the instance, whichever is longer. For more information, see [Working with storage for Amazon RDS DB instances](USER_PIOPS.StorageTypes.md)

For more information about storage, see [Amazon RDS DB instance storage](CHAP_Storage.md).

For general information about storage modification, see [Working with storage for Amazon RDS DB instances](USER_PIOPS.StorageTypes.md).

**Important**  
Do not modify storage for your RDS Custom for SQL Server DB instance using Amazon EC2 or Amazon EBS consoles or APIs. Direct storage modifications outside of Amazon RDS console or APIs result in an `unsupported-configuration` state for your database.  
When you make direct storage changes using Amazon EC2 or Amazon EBS, Amazon RDS cannot track or manage your database instance state. This might cause:  
High availability failover mechanisms from functioning correctly
Database replication setups to break
Redundancy features to fail
Modify storage only through Amazon RDS console or APIs to keep your database in a supported state. See [Fixing unsupported configurations in RDS Custom for SQL Server](custom-troubleshooting-sqlserver.md#custom-troubleshooting-sqlserver.fix-unsupported) for recovery steps.

## Console
<a name="custom-managing.storage-modify.CON"></a>

**To modify the storage for an RDS Custom for SQL Server DB instance**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. Choose the DB instance that you want to modify.

1. Choose **Modify**.

1. Make the following changes as needed:

   1. Enter a new value for **Allocated storage**. It must be greater than the current value, and from 20 GiB–16 TiB.

   1. Change the value for **Storage type**. You can choose from the available General Purpose or Provisioned IOPS storage types. Provisioned IOPS is supported for the gp3, io1, and io2 Block Express storage types.

   1. If you're specifying a storage type that supports Provisioned IOPS, you can define the **Provisioned IOPS** value.

1. Choose **Continue**.

1. Choose **Apply immediately** or **Apply during the next scheduled maintenance window**.

1. Choose **Modify DB instance**.

## AWS CLI
<a name="custom-managing-sqlserver.storage-modify.CLI"></a>

To modify the storage for an RDS Custom for SQL Server DB instance, use the [modify-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) AWS CLI command. Set the following parameters as needed:
+ `--allocated-storage` – Amount of storage to be allocated for the DB instance, in gibibytes. It must be greater than the current value, and from 20–16,384 GiB.
+ `--storage-type` – The storage type, for example, gp2, gp3, io1, or io2.
+ `--iops` – Provisioned IOPS for the DB instance. You can specify this only for storage types that support Provisioned IOPS (gp3, io1, and io2).
+ `--apply-immediately` – Use `--apply-immediately` to apply the storage changes immediately.

  Or use `--no-apply-immediately` (the default) to apply the changes during the next maintenance window.

The following example changes the storage size of my-custom-instance to 200 GiB, storage type to io1, and Provisioned IOPS to 3000.

**Example**  
For Linux, macOS, or Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --storage-type io1 \
    --iops 3000 \
    --allocated-storage 200 \
    --apply-immediately
```
For Windows:  

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --storage-type io1 ^
    --iops 3000 ^
    --allocated-storage 200 ^
    --apply-immediately
```

# Tagging RDS Custom for SQL Server resources
<a name="custom-managing-sqlserver.tagging"></a>

You can tag RDS Custom resources as with Amazon RDS resources, but with some important differences:
+ Don't create or modify the `AWSRDSCustom` tag that's required for RDS Custom automation. If you do, you might break the automation.
+ The `Name` tag is added to RDS Custom resources with the prefix `do-not-delete-rds-custom`. Any customer-passed value for the key is overwritten.
+ Tags added to RDS Custom DB instances during creation are propagated to all other related RDS Custom resources.
+ Tags aren't propagated when you add them to RDS Custom resources after DB instance creation.

For general information about resource tagging, see [Tagging Amazon RDS resources](USER_Tagging.md).

## Deleting an RDS Custom for SQL Server DB instance
<a name="custom-managing-sqlserver.deleting"></a>

To delete an RDS Custom for SQL Server DB instance, do the following:
+ Provide the name of the DB instance.
+ Choose or clear the option to take a final DB snapshot of the DB instance.
+ Choose or clear the option to retain automated backups.

You can delete an RDS Custom for SQL Server DB instance using the console or the CLI. The time required to delete the DB instance can vary depending on the backup retention period (that is, how many backups to delete), how much data is deleted, and whether a final snapshot is taken.

**Warning**  
Deleting a RDS Custom for SQL Server DB instance will permanently delete the EC2 instance and the associated Amazon EBS volumes. You shouldn’t terminate or delete these resources at any time, otherwise, the deletion and the final snapshot creation may fail.

**Note**  
You can't create a final DB snapshot of your DB instance if it has a status of `creating`, `failed`, `incompatible-create`, `incompatible-restore`, or `incompatible-network`. For more information, see [Viewing Amazon RDSDB instance status](accessing-monitoring.md#Overview.DBInstance.Status).

**Important**  
When you choose to take a final snapshot, we recommend that you avoid writing data to your DB instance while the DB instance deletion is in progress. Once the DB instance deletion is initiated, data changes are not guaranteed to be captured by the final snapshot.

### Console
<a name="custom-managing-sqs.deleting.console"></a>

**To delete an RDS Custom DB instance**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**, and then choose the RDS Custom for SQL Server DB instance that you want to delete. RDS Custom for SQL Server DB instances show the role **Instance (RDS Custom for SQL Server)**.

1. For **Actions**, choose **Delete**.

1. To take a final snapshot, choose **Create final snapshot**, and provide a name for the **Final snapshot name**.

1. To retain automated backups, choose **Retain automated backups**.

1. Enter **delete me** in the box.

1. Choose **Delete**.

### AWS CLI
<a name="custom-managing-sqs.deleting.CLI"></a>

You delete an RDS Custom for SQL Server DB instance by using the [delete-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/delete-db-instance.html) AWS CLI command. Identify the DB instance using the required parameter `--db-instance-identifier`. The remaining parameters are the same as for an Amazon RDS DB instance.

The following example deletes the RDS Custom for SQL Server DB instance named `my-custom-instance`, takes a final snapshot, and retains automated backups.

**Example**  
For Linux, macOS, or Unix:  

```
aws rds delete-db-instance \
    --db-instance-identifier my-custom-instance \
    --no-skip-final-snapshot \
    --final-db-snapshot-identifier my-custom-instance-final-snapshot \
    --no-delete-automated-backups
```
For Windows:  

```
aws rds delete-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --no-skip-final-snapshot ^
    --final-db-snapshot-identifier my-custom-instance-final-snapshot ^
    --no-delete-automated-backups
```

To take a final snapshot, the `--final-db-snapshot-identifier` option is required and must be specified.

To skip the final snapshot, specify the `--skip-final-snapshot` option instead of the `--no-skip-final-snapshot` and `--final-db-snapshot-identifier` options in the command.

To delete automated backups, specify the `--delete-automated-backups` option instead of the `--no-delete-automated-backups` option in the command.

# Starting and stopping an RDS Custom for SQL Server DB instance
<a name="custom-managing-sqlserver.startstop"></a>

You can start and stop your RDS Custom for SQL Server DB instance. The same general requirements and limitations for RDS for SQL Server DB instances apply to stopping and starting your RDS Custom for SQL Server DB instances. For more information, see [Stopping an Amazon RDS DB instance temporarily](USER_StopInstance.md).

The following considerations also apply to starting and stopping your RDS Custom for SQL Server DB instance:
+ Modifying an EC2 instance attribute of an RDS Custom for SQL Server DB instance while the DB instance is `STOPPED` isn't supported.
+ You can stop and start an RDS Custom for SQL Server DB instance only if it's configured for a single Availability Zone. You can't stop an RDS Custom for SQL Server DB instance in a Multi-AZ configuration.
+ A `SYSTEM` snapshot will be created when you stop an RDS Custom for SQL Server DB instance. The snapshot will be automatically deleted when you start the RDS Custom for SQL Server DB instance again.
+ If you delete your EC2 instance while your RDS Custom for SQL Server DB instance is stopped, the `C:` drive will be replaced when you start the RDS Custom for SQL Server DB instance again.
+ The `C:\` drive, hostname, and your custom configurations are persisted when you stop an RDS Custom for SQL Server DB instance, as long as you don't modify the instance type.
+ The following actions will result in RDS Custom placing the DB instance outside the support perimeter, and you're still charged for DB instance hours:
  + Starting the underlying EC2 instance while Amazon RDS is stopped. To resolve, you can call the `start-db-instance` Amazon RDS API, or stop the EC2 so the RDS Custom instance returns to `STOPPED`.
  + Stopping underlying EC2 instance when the RDS Custom for SQL Server DB instance is `ACTIVE`.

For more details about stopping and starting DB instances, see [Stopping an Amazon RDS DB instance temporarily](USER_StopInstance.md), and [Starting an Amazon RDS DB instance that was previously stopped](USER_StartInstance.md).

# Working with Microsoft Active Directory with RDS Custom for SQL Server
<a name="custom-sqlserver-WinAuth"></a>

RDS Custom for SQL Server allows to join your instances to a Self-Managed Active Directory (AD) or AWS Managed Microsoft AD. This is regardless of where your AD is hosted, like an On-premises data center, Amazon EC2 or with any other cloud service providers.

For authentication of users and services, you can use NTLM or Kerberos authentication on your RDS Custom for SQL Server DB instance without using intermediary domains and forest trusts. When a user tries to authenticate on your RDS Custom for SQL Server DB instance with a self joined Active Directory, requests for authentication are forwarded to a self-managed AD or AWS Managed Microsoft AD that you specify.

In the following sections, you can find information about working with Self Managed Active Directory and AWS Managed Active Directory for RDS Custom for SQL Server.

**Topics**
+ [

## Region and version availability
](#custom-sqlserver-WinAuth.Regions)
+ [

# Configure Self-Managed or On-premise AD
](custom-sqlserver-WinAuth.config-Self-Managed.md)
+ [

# Configure Microsoft Active Directory using Directory Service
](custom-sqlserver-WinAuth.config-ADS.md)
+ [

# Network configuration port rules
](custom-sqlserver-WinAuth.NWConfigPorts.md)
+ [

# Network Validation
](custom-sqlserver-WinAuth.NWValidation.md)
+ [

# Setting up Windows Authentication for RDS Custom for SQL Server instances
](custom-sqlserver-WinAuth.settingUp.md)
+ [

# Managing a DB instance in a Domain
](custom-sqlserver-WinAuth.ManagingDBI.md)
+ [

# Understanding Domain membership
](custom-sqlserver-WinAuth.Understanding.md)
+ [

# Troubleshooting Active Directory
](custom-sqlserver-WinAuth.Troubleshoot.md)

## Region and version availability
<a name="custom-sqlserver-WinAuth.Regions"></a>

RDS Custom for SQL Server supports both Self Managed AD and AWS Managed Microsoft AD using NTLM or Kerberos in all Regions where RDS Custom for SQL Server is supported. For more information, see [Supported Regions and DB engines for RDS Custom](Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.md).

# Configure Self-Managed or On-premise AD
<a name="custom-sqlserver-WinAuth.config-Self-Managed"></a>

To join your on-premise or self-managed Microsoft AD to your RDS Custom for SQL Server DB instance, your Active Domain must be configured as follows:
+ Define the subnets in the VPC associated with your RDS Custom for SQL Server DB instance in your self-managed or on-premises AD. Confirm there are no conflicts between the subnets in your VPC and the subnets in your AD sites. 
+ Your AD domain controller has a domain functional level of Windows Server 2008 R2 or higher.
+ Your AD domain name can't be in Single Lable Domain (SLD) format. RDS Custom for SQL Server does not support SLD domains.
+ The fully qualified domain name (FQDN) for your AD can't exceed 47 characters.

## Configure your network connectivity
<a name="custom-sqlserver-WinAuth.config-Self-Managed.network"></a>

Configure your self-managed or on-premise AD network connectivity in the following manner:
+ Set up connectivity between Amazon VPC where your RDS Custom for SQL Server instance is running, and your AD. Use Direct Connect, Site-to-Site VPN, AWS Transit Gateway, and VPC Peering.
+ Allow traffic on the ports your RDS Custom for SQL Server security groups and network ACLs to your self-managed or on-premise AD. For more information, see [Network configuration port rules](custom-sqlserver-WinAuth.NWConfigPorts.md).  
![\[Microsoft SQL Server Windows Authentication directory\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/custom-sqs-SM-NC.png)

## Configure DNS resolution
<a name="custom-sqlserver-WinAuth.config-Self-Managed.DNS"></a>

Set up the following requirements to configure DNS resolution with self-managed or on-premises AD's:
+ Configure DNS resolution within your VPC to resolve your self-hosted Active Directory's fully qualified domain name (FQDN). An example of an FQDN is `corp.example.local`. To configure DNS resolution, configure the VPC DNS resolver to forward queries for certain domains with an Amazon Route 53 outbound endpoint and resolver rule. For more information, see [ Configure a Route 53 Resolver outbound endpoint to resolve DNS records](https://repost.aws/knowledge-center/route53-resolve-with-outbound-endpoint).
+ For workloads that leverage both VPCs and on-premises resources, you must resolve DNS records hosted on-premises. On-premise resources might need to resolve names hosted on AWS.

  To create a hybrid cloud setup, use resolver endpoints and conditional forwarding riles to resolve DNS queries between your on-premise resources and custom VPC. For more information, see [ Resolving DNS queries between VPCs and your network](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-overview-DSN-queries-to-vpc.html) in the *Amazon Route 53 Developer Guide*.

**Important**  
Modifying the DNS resolver settings of the network interface on the RDS Custom for SQL Server causes DNS-enabled VPC endpoints to no longer work correctly. DNS-enabled VPC endpoints are required for instances within private subnets without internet access.

# Configure Microsoft Active Directory using Directory Service
<a name="custom-sqlserver-WinAuth.config-ADS"></a>

AWS Managed Microsoft AD creates a fully managed Microsoft Active Directory in AWS that is powered by Windows Server 2019 and operates at the 2012 R2 Forest and Domain functional levels. Directory Service creates the domain controllers in different subnets in an Amazon VPC, making your directory highly available even in the event of failure.

To create a directory with AWS Managed Microsoft AD, see [Getting started with AWS Managed Microsoft AD](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_getting_started.html) in the *AWS Directory Service Administration Guide*.

## Configure your network connectivity
<a name="custom-sqlserver-WinAuth.config-ADS.network"></a>

### Enable cross-VPC traffic between the directory and the DB instance
<a name="custom-sqlserver-WinAuth.config-ADS.network.x-vpc"></a>

To locate the directory and the DB instance in the same VPC, skip this step and move on to next step in [Network configuration port rules](custom-sqlserver-WinAuth.NWConfigPorts.md).

To locate the directory and the DB instance in different VPCs, configure cross-VPC traffic using VPC peering or AWS Transit Gateway. For more information about using VPC peering, see [What is VPC peering?](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) in the *Amazon VPC Peering Guide* and [What is AWS Transit Gateway?](https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html) in the *Amazon VPC Transit Gateways*.

**Enable cross-VPC traffic using VPC peering**

1. Set up appropriate VPC routing rules to ensure that network traffic can flow both ways.

1. Allow the DB instance's security group to recieve inbound traffic from the directory's security group. For more information, see [Network configuration port rules](custom-sqlserver-WinAuth.NWConfigPorts.md).

1. Network access control list (ACL) must not block traffic.

If a different AWS account owns the directory, you must share the directory. To share the directory with AWS account within which the RDS Custom for SQL Server instance is by following the [ Tutorial: Sharing your AWS Managed Microsoft AD for seamless EC2 domain-join](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_tutorial_directory_sharing.html) in the *AWS Directory Service Administration Guide*.

**Sharing a directory betweens AWS accounts**

1. Sign in to the Directory Service console using the account for the DB instance and check if the domain has the `SHARED` status before proceeding.

1. After signing in to the Directory Service console using the account for the DB instance, note the **Directory ID** value. You use this ID to join the DB instance to the domain.

## Configure DNS resolution
<a name="custom-sqlserver-WinAuth.config-ADS.DNS"></a>

When you create a directory with AWS Managed Microsoft AD, Directory Service creates two domain controllers and adds the DNS service on your behalf.

If you have an existing AWS Managed Microsoft AD or plan on launching one in a VPC other than your RDS Custom for SQL Server DB instance, configure the VPC DNS resolver to forward queries for certain domains with a Route 53 outbound and resolver rule, see [ Configure a Route 53 Resolver outbound endpoint to resolve DNS records](https://repost.aws/knowledge-center/route53-resolve-with-outbound-endpoint).

# Network configuration port rules
<a name="custom-sqlserver-WinAuth.NWConfigPorts"></a>

Make sure that you have met the following network configurations:
+ Connectivity configured between the Amazon VPC where you want to create the RDS Custom for SQL Server DB instance to either your self-managed Active Directory or AWS Managed Microsoft AD. For self-managed Active Directory, set up connectivity using AWS Direct Connect, AWS VPN, VPC peering, or AWS Transit Gateway. For AWS Managed Microsoft AD, set up connectivity using VPC peering.
+ Make sure that the security group and the VPC network ACLs for the subnet(s) where you're creating your RDS Custom for SQL Server DB instance allow traffic on the ports and in the directions shown in the following diagram.  
![\[Microsoft Active Directory network configuration port rules.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/custom_sqlserver_ActiveDirectory_Requirements_NetworkConfig.png)

  The following table identifies the role of each port.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-sqlserver-WinAuth.NWConfigPorts.html)
+ Generally, the domain DNS servers are located in the AD domain controllers. You do not need to configure the VPC DHCP option set to use this feature. For more information, see [DHCP option sets](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html) in the *Amazon VPC User Guide*.

**Important**  
If you're using VPC network ACLs, you must also allow outbound traffic on dynamic ports (49152-65535) from your RDS Custom for SQL Server DB instance. Ensure that these traffic rules are also mirrored on the firewalls that apply to each of the AD domain controllers, DNS servers, and RDS Custom for SQL Server DB instances.  
While VPC security groups require ports to be opened only in the direction that network traffic is initiated, most Windows firewalls and VPC network ACLs require ports to be open in both directions.

# Network Validation
<a name="custom-sqlserver-WinAuth.NWValidation"></a>

Before joining your RDS Custom instance to either self-managed or AWS Managed Microsoft AD, check the following from a EC2 instance in the same VPC as where you plan to launch the RDS Custom for SQL Server instance. 
+ Check if you are able to resolve the fully qualified domain name (FQDN) to domain controller IPs.

  ```
  nslookup corp.example.com
  ```

  The command must return a similar output:

  ```
  Server:  ip-10-0-0-2.us-west-2.compute.internal
  Address:  25.0.0.2
  
  Non-authoritative answer:
  Name:    corp.example.com
  Addresses:  40.0.9.25 (DC1 IP)
              40.0.50.123 (DC2 IP)
  ```
+ Resolve AWS services from an EC2 instance in the VPC where you are launching your RDS Custom instance:

  ```
  $region='input-your-aws-region'
  $domainFQDN='input-your-domainFQDN'
   
  function Test-DomainPorts {
      param (
          [string]$Domain,
          [array]$Ports
      )
   
      foreach ($portInfo in $Ports) {
          try {
              $conn = New-Object System.Net.Sockets.TcpClient
              $connectionResult = $conn.BeginConnect($Domain, $portInfo.Port, $null, $null)
              $success = $connectionResult.AsyncWaitHandle.WaitOne(1000) # 1 second timeout
              if ($success) {
                  $conn.EndConnect($connectionResult)
                  $result = $true
              } else {
                  $result = $false
              }
          }
          catch {
              $result = $false
          }
          finally {
              if ($null -ne $conn) {
                  $conn.Close()
              }
          }
          Write-Host "$($portInfo.Description) port open: $result"
      }
  }
   
  # Check if ports can be reached 
  $ports = @(
      @{Port = 53;   Description = "DNS"},
      @{Port = 88;   Description = "Kerberos"},
      @{Port = 389;  Description = "LDAP"},
      @{Port = 445;  Description = "SMB"},
      @{Port = 5985; Description = "WinRM"},
      @{Port = 636;  Description = "LDAPS"},
      @{Port = 3268; Description = "Global Catalog"},
      @{Port = 3269; Description = "Global Catalog over SSL"},
      @{Port = 9389; Description = "AD DS"}
  )
   
  function Test-DomainReachability {
      param (
          [string]$DomainName
      )
      
      try {
          $dnsResults = Resolve-DnsName -Name $DomainName -ErrorAction Stop
          Write-Host "Domain $DomainName is successfully resolving to following IP addresses: $($dnsResults.IpAddress)"
          Write-Host ""
          return $true
      } 
      catch {
          Write-Host ""
          Write-Host "Error Message: $($_.Exception.Message)"
          Write-Host "Domain $DomainName reachability check failed, please Configure DNS resolution"
          return $false
      }
  }
   
  $domain = (Get-WmiObject Win32_ComputerSystem).Domain
  if ($domain -eq 'WORKGROUP') {
      Write-Host ""    
      Write-Host "Host $env:computername is still part of WORKGROUP and not part of any domain"
      }
  else {
      Write-Host ""
      Write-Host "Host $env:computername is joined to $domain domain"
      Write-Host ""
      }
   
   
  $isReachable = Test-DomainReachability -DomainName $domainFQDN  
  if ($isReachable) {
      write-Host "Checking if domain $domainFQDN is reachable on required ports  "
      Test-DomainPorts -Domain $domainFQDN -Ports $ports
  }
  else {
      Write-Host "Port check skipped. Domain not reachable"
  }   
   
   
   
  # Get network adapter configuration
  $networkConfig = Get-WmiObject Win32_NetworkAdapterConfiguration | 
                   Where-Object { $_.IPEnabled -eq $true } |
                   Select-Object -First 1
   
  # Check DNS server settings
  $dnsServers = $networkConfig.DNSServerSearchOrder
   
  if ($dnsServers) {
      Write-Host "`nDNS Server settings:"
      foreach ($server in $dnsServers) {
          Write-Host "  - $server"
      }
  } else {
      Write-Host "`nNo DNS servers configured or unable to retrieve DNS server information."
  }
   
  write-host ""
   
  # Checks reachability to dependent services
  $services = "s3", "ec2", "secretsmanager", "logs", "events", "monitoring", "ssm", "ec2messages", "ssmmessages"
   
  function Get-TcpConnectionAsync {
      param (
          $ServicePrefix,
          $region
      )
      $endpoint = "${ServicePrefix}.${region}.amazonaws.com"
      $tcp = New-Object Net.Sockets.TcpClient
      $result = $false
   
      try {
          $connectTask = $tcp.ConnectAsync($endpoint, 443)
          $timedOut = $connectTask.Wait(3000)
          $result = $tcp.Connected
      } 
      catch {
          $result = $false
      } 
      return $result
  }
   
  foreach ($service in $services) {
      $validationResult = Get-TcpConnectionAsync -ServicePrefix $service -Region $region
      Write-Host "Reachability to $service is $validationResult"
  }
  ```

  The `TcpTestSucceeded` value must return `True` for `s3`, `ec2`, `secretsmanager`, `logs`, `events`, `monitoring`, `ssm`, `ec2messages`, and `ssmmessages`.

# Setting up Windows Authentication for RDS Custom for SQL Server instances
<a name="custom-sqlserver-WinAuth.settingUp"></a>

We recommend creating a dedicated OU and service credentials scoped to that OU for any AWS account that owns an RDS Custom for SQL Server DB instance joined to your AD domain. By dedicating an OU and service credentials, you avoid conflicting permissions and follow the principle of least privilege.

Active directory level group policies might conflict with AWS automations and permissions. We recommend selecting GPO's that apply only to the OU that you create for RDS Custom for SQL Server.
+ To create OU and AD domain user in your self-managed or on-premise AD, you can connect the domain controller as a domain administrator.
+ To create users and groups in an Directory Service directory, you must be connected to a management instance and you must also be logged in as a user with privileges to create users and groups. For more information, see [User and group management in AWS Managed Microsoft AD](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_manage_users_groups.html) in the *AWS Directory Service Administration Guide*.
+ To manage your Active Directory from Amazon EC2 Windows Server instance, you need to install the Active Directory domain services and Active Directory Lightweight Directory services tools on the EC2 instance. For more information, see [Installing Active Directory Administration Tools for AWS Managed Microsoft AD](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_install_ad_tools.html) in the *AWS Directory Service Administration Guide*.
+ We recommend that you install these tools on a separate EC2 instance for administration, and not on your RDS Custom for SQL Server DB instance for ease of administration.

The following are the requirements for an AD domain service account:
+ You must have a service account in your AD domain with delegated permissions to join computers to the domain. A domain service account is a user account in your AD that has delegated permission to perform certain tasks.
+ Delegate the following permissions to your domain service account in the Organizational Unit that you're joining your RDS Custom for SQL Server instance to:
  + Validated ability to write to the DNS host name
  + Validated ability to write to the service principal name
  + Create and delete computer objects
+ For self-managed and on-premises AD, the domain service account must be a member of the "AWS Delegated Domain Name System Administrators" group.
+ For AWS Managed Microsoft AD, the domain service account should be member of "DnsAdmins" group.

These are the minimum set of permissions required to join computer objects to your self-managed AD and AWS Managed Microsoft AD. For more information, see [ Error: Access is denied when non-administrator users who have been delegated control try to join computers to a domain controller](https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/access-denied-when-joining-computers) in the Microsoft Windows Server documentation.

**Important**  
Do not move computer objects that RDS Custom for SQL Server creates in the Organizational Unit (OU) after your DB instance is created. Moving associated objects might cause your RDS Custom for SQL Server DB instance to become misconfigured. If you need to move the computer objects created by Amazon RDS, use the [ ModifyDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html) action to modify the domain parameters with the desired location of the computer objects.

**Topics**
+ [

## Step 1: Create an organizational unit (OU) in your AD
](#custom-sqlserver-WinAuth.settingUp.CreateOU)
+ [

## Step 2: Create an AD domain user
](#custom-sqlserver-WinAuth.settingUp.ADuser)
+ [

## Step 3: Delegate control to the AD user in self-managed or AWS Managed Microsoft AD
](#custom-sqlserver-WinAuth.settingUp.Delegate)
+ [

## Step 4: Create a secret
](#custom-sqlserver-WinAuth.settingUp.ASM)
+ [

## Step 5: Create or modify a RDS Custom for SQL Server DB instance
](#custom-sqlserver-WinAuth.settingUp.CreateDBInstance)
+ [

## Step 6: Create Windows Authentication SQL Server Login
](#custom-sqlserver-WinAuth.settingUp.CreateLogins)
+ [

## Step 7: Using Kerberos or NTLM Authentication
](#custom-sqlserver-WinAuth.settingUp.KerbNTLM)

## Step 1: Create an organizational unit (OU) in your AD
<a name="custom-sqlserver-WinAuth.settingUp.CreateOU"></a>

Use the following steps to create an organization unit in your AD:

**Create an OU in your AD**

1. Connect to your domain AD as a domain administrator.

1. Open **Active Directory Users and Computers** and select the domain where you want to create your OU.

1. Right-click the domain and choose **New**, then **Organization Unit**.

1. Enter a name for the OU.

   Enable **Protect container from accidental deletion**.

1. Choose **OK**. Your new OU appears under your domain.

For AWS Managed Microsoft AD, the name of this OU is based off the NetBIOS name you typed when you created your directory. This OU is owned by AWS and contains all of your AWS-related directory objects, which you are granted full control over. By default, two child OUs exist under this OU, namely **Computers and Users**. New OUs that RDS Custom creates are a child of the OU that is based off of the NetBIOS.

## Step 2: Create an AD domain user
<a name="custom-sqlserver-WinAuth.settingUp.ADuser"></a>

The domain user credentials are used for the secret in Secrets Manager.

**Create an AD domain user in your AD**

1. Open **Active Directory Users and Computers** and select the domain and OU where you want to create the user.

1. Right-click the **Users** object and choose **New**, then **User**.

1. Enter a first name, last name, and login name for the user. Click **Next**.

1. Enter a password for the user. Don't select **User must change password at next login** or **Account is disabled.**. Click **Next**.

1. Click **OK**. You new user appears under your domain.

## Step 3: Delegate control to the AD user in self-managed or AWS Managed Microsoft AD
<a name="custom-sqlserver-WinAuth.settingUp.Delegate"></a>

**To delegate control to the AD domain user in your domain**

1. Open **Active Directory Users and Computers** MMC snap-in and select your domain.

1. Right-click on the OU you created earlier and choose **Delegate Control**.

1. In the **Delegation Control Wizard**, click **Next**.

1. In **Users or Groups** section, click **Add**.

1. In **Select Users, Computers, or Groups**, enter the AD user you created and click **Check Names**. If your AD user check is successful, click **OK**.

1. In the **Users or Groups** section, confirm your AD user was added and click **Next**.

1. In the **Tasks to Delegate** section, choose **Create a custom task to delegate** and click **Next**.

1. In the **Active Directory Object Type** section:

   Choose **ONly the following objects in the folder**.

   Select **Computer Objects**

   Select **Create selected objects in this folder**

   Select **Delete selected objects in this folder** and click **Next**.

1. In the **Permissions** section:

   Keep **General** selected.

   Select **Validated write to DNS host name**.

   Select **Validated write to service principal name** and click **Next**.

1. In **Completing the Delegation of Control Wizard**, confirm your settings and click **Finish**.

## Step 4: Create a secret
<a name="custom-sqlserver-WinAuth.settingUp.ASM"></a>

Create the secret in the same AWS account and Region that contains the RDS Custom for SQL Server DB instance that you want to include in your active directory. Store credentials of the AD domain user created in [Step 2: Create an AD domain user](#custom-sqlserver-WinAuth.settingUp.ADuser).

------
#### [ Console ]
+ In AWS Secrets Manager, choose **Store a new secret**.
+ For **Secret type**, choose **Other type of secret**.
+ For **Key/value pairs**, add two keys:
  + The first key, `SELF_MANAGED_ACTIVE_DIRECTORY_USERNAME` and enter the name of your AD user (without the domain prefix) for the value.
  + For the second key, enter `SELF_MANAGED_ACTIVE_DIRECTORY_PASSWORD` and enter the password for your AD user on your domain.
+ For **Encryption key**, enter the same AWS KMS key you used to create RDS Custom for SQL Server instance.
+ For **Secret name**, choose the secret name starting with `do-not-delete-rds-custom-` to allow your instance profile to access this secret. IF you want to choose a different name for the secret, update `RDSCustomInstanceProfile` to access **Secret name**.
+ (Optional) For **Description**, enter a description for the secret name.
+ Add the tags `Key="AWSRDSCustom",Value="custom-sqlserver"` 
+ Click **Save**, then **Next**.
+ For **Configure rotation settings**, keep the default values and choose **Next**.
+ Review the settings for the secret and click **Store**.
+ Choose the new secret and copy the value for **Secret ARN**. We use this in the next step to set up you Active Directory.

------
#### [ CLI ]

Run the following command in your CLI to create a secret:

```
# Linux based
aws secretsmanager create-secret \
--name do-not-delete-rds-custom-DomainUserCredentails \ 
--description "Active directory user credentials for managing RDS Custom" \ 
--secret-string "{\"SELF_MANAGED_ACTIVE_DIRECTORY_USERNAME\":\"tester\",\"SELF_MANAGED_ACTIVE_DIRECTORY_PASSWORD\":\"xxxxxxxx\"}" \
--kms-key-id <RDSCustomKMSKey> \
--tags Key="AWSRDSCustom",Value="custom-sqlserver"

# Windows based
aws secretsmanager create-secret ^
--name do-not-delete-rds-custom-DomainUserCredentails ^ 
--description "Active directory user credentials for managing RDS Custom" ^
--secret-string "{\"SELF_MANAGED_ACTIVE_DIRECTORY_USERNAME\":\"tester\",\"SELF_MANAGED_ACTIVE_DIRECTORY_PASSWORD\":\"xxxxxxxx\"}" ^
--kms-key-id <RDSCustomKMSKey> ^
--tags Key="AWSRDSCustom",Value="custom-sqlserver"
```

------

## Step 5: Create or modify a RDS Custom for SQL Server DB instance
<a name="custom-sqlserver-WinAuth.settingUp.CreateDBInstance"></a>

Create or modify a RDS Custom for SQL Server DB instance for use with your directory. You can use the console, CLI, or RDS API to associate a DB instance with a directory. You can do this in one of the following ways:
+ Create a new SQL Server DB instance using the console, the [create-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html) CLI command, or the [CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) RDS API operation.

  For instructions, see [Creating an Amazon RDS DB instance](USER_CreateDBInstance.md).
+ Modify an existing SQL Server DB instance using the console, the [modify-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) CLI command, or the [ModifyDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html) RDS API operation.

  For instructions, see [Modifying an Amazon RDS DB instance](Overview.DBInstance.Modifying.md).
+ Restore a SQL Server DB instance from a DB snapshot using the console, the [restore-db-instance-from-db-snapshot](https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-from-db-snapshot.html) CLI command, or the [RestoreDBInstanceFromDBSnapshot](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBInstanceFromDBSnapshot.html) RDS API operation.

  For instructions, see [Restoring to a DB instance](USER_RestoreFromSnapshot.md).
+ Restore a SQL Server DB instance to a point-in-time using the console, the [restore-db-instance-to-point-in-time](https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-to-point-in-time.html) CLI command, or the [RestoreDBInstanceToPointInTime](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBInstanceToPointInTime.html) RDS API operation.

  For instructions, see [Restoring a DB instance to a specified time for Amazon RDS](USER_PIT.md).

**Note**  
If your RDS Custom for SQL Server instance is already joined to an AD manually, check the settings for [Network configuration port rules](custom-sqlserver-WinAuth.NWConfigPorts.md), [Network Validation](custom-sqlserver-WinAuth.NWValidation.md), and complete steps 1 though Step 4. Update the `--domain-fqdn`, `--domain-ou`, and `--domain-auth-secret-arn` to your AD, so that domain join credentials and configurations are registered with RDS Custom to monitor, register CNAME, and take recovery actions. 

When you use the AWS CLI, the following parameters are required for the DB instance to be able to use the directory that you created:
+ For the `--domain-fqdn` parameter, use the fully qualified domain name of your self-managed AD.
+ For the `--domain-ou` parameter, use the OU that you created in your self-managed AD.
+ For the `--domain-auth-secret-arn` parameter, use the value of the **Secret ARN** that you created.

**Important**  
If you modify a DB instance to join or remove from a self-managed AD domain or AWS Managed Microsoft AD, a reboot of the DB instance is required for the modification to take effect. You can choose to apply the changes immediately or wait until the next maintenance window. Choosing the **Apply Immediately** option causes downtime for a single-AZ DB instance. A Multi-AZ DB cluster performs a failover before completing a reboot. For more information, see [Modifying an Amazon RDS DB instance](Overview.DBInstance.Modifying.md).

The following CLI command creates a new RDS Custom for SQL Server DB instance and joins it to self-managed or AWS Managed Microsoft AD domain.

For Linux, macOS, or Unix:

```
aws rds create-db-instance  \
--engine custom-sqlserver-se \
--engine-version 15.00.4312.2.v1 \
--db-instance-identifier my-custom-instance \
--db-instance-class db.m5.large \
--allocated-storage 100 --storage-type io1 --iops 1000 \
--master-username my-master-username \
--master-user-password my-master-password \
--kms-key-id  my-RDSCustom-key-id \
--custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance  \
--domain-fqdn "corp.example.com" \
--domain-ou "OU=RDSCustomOU,DC=corp,DC=example,DC=com" \
--domain-auth-secret-arn "arn:aws:secretsmanager:region:account-number:secret:do-not-delete-rds-custom-my-AD-test-secret-123456" \
--db-subnet-group-name my-DB-subnet-grp \
--vpc-security-group-ids  my-securitygroup-id \
--no-publicly-accessible \
--backup-retention-period 3 \
--port 8200 \
--region us-west-2 \
--no-multi-az
```

For Windows:

```
aws rds create-db-instance  ^
--engine custom-sqlserver-se ^
--engine-version 15.00.4312.2.v1 ^
--db-instance-identifier my-custom-instance ^
--db-instance-class db.m5.large ^
--allocated-storage 100 --storage-type io1 --iops 1000 ^
--master-usernamemy-master-username ^
--master-user-password my-master-password ^
--kms-key-id  my-RDSCustom-key-id ^
--custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance  ^
--domain-fqdn "corp.example.com" ^
--domain-ou "OU=RDSCustomOU,DC=corp,DC=example,DC=com" ^
--domain-auth-secret-arn "arn:aws:secretsmanager:region:account-number:secret:do-not-delete-rds-custom-my-AD-test-secret-123456" ^
--db-subnet-group-name my-DB-subnet-grp ^
--vpc-security-group-ids  my-securitygroup-id ^
--no-publicly-accessible ^
--backup-retention-period 3 ^
--port 8200 ^
--region us-west-2 ^
--no-multi-az
```

**Important**  
If your NetBIOS for AWS Managed Microsoft AD is **corpexample**, then it appears as an OU itself. Any new OU created earlier will appear as a nested OU. For AWS Managed Microsoft AD, set `--domain-ou` to `"OU=RDSCustomOU,OU=corpexample,DC=corp,DC=example,DC=com"`.

The following command modifies an existing RDS Custom for SQL Server DB instance to use an Active Directory domain.

For Linux, macOS, or Unix:

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --domain-fqdn "corp.example.com" \
    --domain-ou "OU=RDSCustomOU,DC=corp,DC=example,DC=com" \
    --domain-auth-secret-arn "arn:aws:secretsmanager:region:account-number:secret:do-not-delete-rds-custom-my-AD-test-secret-123456" \
```

For Windows:

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --domain-fqdn "corp.example.com" ^
    --domain-ou "OU=RDSCustomOU,DC=corp,DC=example,DC=com" ^
    --domain-auth-secret-arn "arn:aws:secretsmanager:region:account-number:secret:do-not-delete-rds-custom-my-AD-test-secret-123456" ^
```

The following CLI command removes and RDS Custom for SQL Server DB instance from a Active Directory domain.

For Linux, macOS, or Unix:

```
aws rds modify-db-instance \
    --db-instance-identifier my-custom-instance \
    --disable-domain
```

For Windows:

```
aws rds modify-db-instance ^
    --db-instance-identifier my-custom-instance ^
    --disable-domain
```

When using the console to create or modify your instance, click on **Enable Microsoft SQL Server Windows Authentication** to see the following options.

![\[Microsoft SQL Server Windows Authentication directory\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/custom-sqs-WinAuth.png)


You are responsible to make sure your domain FQDN is resolving to the domain controller IP addresses. If domain controller IPs are not resolving, domain join operations fail but RDS Custom for SQL Server instance creation succeeds. For troubleshooting information, see [Troubleshooting Active Directory](custom-sqlserver-WinAuth.Troubleshoot.md). 

## Step 6: Create Windows Authentication SQL Server Login
<a name="custom-sqlserver-WinAuth.settingUp.CreateLogins"></a>

Use the Amazon RDS master user credentials to connect to the SQL Server DB instance as you do for any other DB instance. Because the DB instance is joined to the AD domain, you can provision SQL Server logins and users. You do this from the AD users and groups utility in your AD domain. Database permissions are managed through standard SQL Server permissions granted and revoked to these Windows logins.

For an AD user to authenticate with SQL Server, a SQL Server Windows login must exist for the AD user or an Active Directory group that the user is a member of. Fine-grained access control is handled through granting and revoking permissions on these SQL Server logins. An AD user that doesn't have a SQL Server login or belong to an AD group with such a login can't access the SQL Server DB instance.

The `ALTER ANY LOGIN` permission is required to create an AD SQL Server login. If you haven't created any logins with this permission, connect as the DB instance's master user using SQL Server Authentication and create your AD SQL Server logins under the context of the master user.

You can run a data definition language (DDL) command such as the following to create a SQL Server login for an AD user or group.

```
USE [master]
GO
CREATE LOGIN [mydomain\myuser] FROM WINDOWS WITH DEFAULT_DATABASE = [master], DEFAULT_LANGUAGE = [us_english];
GO
```

Users (both humans and applications) from your domain can now connect to the RDS Custom for SQL Server instance from a domain-joined client machine using Windows authentication. 

## Step 7: Using Kerberos or NTLM Authentication
<a name="custom-sqlserver-WinAuth.settingUp.KerbNTLM"></a>

### NTLM authentication using RDS endpoint
<a name="custom-sqlserver-WinAuth.settingUp.KerbNTLM.NTLM"></a>

Each Amazon RDS DB instance has an endpoint and each endpoint has a DNS name and port number for the DB instance. To connect to your DB instance using a SQL client application, you need the DNS name and port number for your DB instance. To authenticate using NTLM authentication, you must connect to the RDS endpoint.

During planned database maintenance or unplanned service disruption, Amazon RDS automatically fails over to the up-to-date secondary database so operations can resume quickly without manual intervention. The primary and secondary instances use the same endpoint, whose physical network address transitions to the secondary as part of the failover process. You don't have to reconfigure your application when a failover occurs.

### Kerberos authentication
<a name="custom-sqlserver-WinAuth.settingUp.KerbNTLM.Kerb"></a>

Kerberos-based authentication for RDS Custom for SQL Server requires connections be made to a specific Service Principal Name (SPN). However, after a failover event, the application might not be aware of the new SPN. To address this, RDS Custom for SQL Server offers a Kerberos-based endpoint.

The Kerberos-based endpoint follows a specific format. If your RDS endpoint is `rds-instance-name.account-region-hash.aws-region.rds.amazonaws.com`, the corresponding Kerberos-based endpoint would be `rds-instance-name.account-region-hash.aws-region.awsrds.fully qualified domain name (FQDN)`.

For example, if the RDS endpoint is `ad-test.cocv6zwtircu.us-east-1.rds.amazonaws.com` and the domain name is `corp-ad.company.com`, the Kerberos-based endpoint would be `ad-test.cocv6zwtircu.us-east-1.awsrds.corp-ad.company.com`.

This Kerberos-based endpoint can be used to authenticate with the SQL Server instance using Kerberos, even after a failover event, as the endpoint is automatically updated to point to the new SPN of the primary SQL Server instance.

### Finding your CNAME
<a name="custom-sqlserver-WinAuth.settingUp.KerbNTLM.CNAME"></a>

To find your CNAME, connect to your domain controller and open **DNS Manager**. Navigate to **Forward Lookup Zones** and your FQDN.

Navigate through **awsrds**, **aws-region**, and **account and region specific hash**.

If you are connecting the RDS Custom EC2 instance and trying to connect to the database locally using CNAME, your connection will use NTLM authentication instead of Kerberos.

If after connecting CNAME from remote client, an NTLM connection is returned, check if required ports are allowlisted.

To check if your connection is using Kerberos, run the following query:

```
SELECT net_transport, auth_scheme
    FROM sys.dm_exec_connections
    WHERE session_id = @@SSPID;
```

# Managing a DB instance in a Domain
<a name="custom-sqlserver-WinAuth.ManagingDBI"></a>

 You can use the console, AWS CLI, or the Amazon RDS API to manage your DB instance and its relationship with your domain. For example, you can move the DB instance into, out of, or between domains. 

 For example, using the Amazon RDS API, you can do the following: 
+  To reattempt a domain join for a failed membership, use the [ModifyDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html) API operation and specify the current membership's directory ID. 
+  To update the IAM role name for membership, use the `ModifyDBInstance` API operation and specify the current membership's directory ID and the new IAM role. 
+  To remove a DB instance from a domain, use the `ModifyDBInstance` API operation and specify `none` as the domain parameter. 
+  To move a DB instance from one domain to another, use the `ModifyDBInstance` API operation and specify the domain identifier of the new domain as the domain parameter. 
+  To list membership for each DB instance, use the [DescribeDBInstances](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/DescribeDBInstances.html) API operation. 

## Restoring a RDS Custom for SQL Server DB instance and adding it to an Active Directory domain
<a name="custom-sqlserver-WinAuth.ManagingDBI.Restoring"></a>

You can restore a DB snapshot or do point-in-time recovery (PITR) for a SQL Server DB instance and then add it to an Active Directory domain. Once the DB instance is restored, modify the instance using the process explained in [Step 5: Create or modify a RDS Custom for SQL Server DB instance](custom-sqlserver-WinAuth.settingUp.md#custom-sqlserver-WinAuth.settingUp.CreateDBInstance) to add the DB instance to an AD domain.

# Understanding Domain membership
<a name="custom-sqlserver-WinAuth.Understanding"></a>

 After you create or modify your DB instance, the instance becomes a member of the domain. The AWS console indicates the status of the domain membership for the DB instance. The status of the DB instance can be one of the following: 
+  **joined** – The instance is a member of the domain.
+  **joining** – The instance is in the process of becoming a member of the domain.
+  **pending-join** – The instance membership is pending.
+  **pending-maintenance-join** – AWS will attempt to make the instance a member of the domain during the next scheduled maintenance window.
+  **pending-removal** – The removal of the instance from the domain is pending.
+  **pending-maintenance-removal** – AWS will attempt to remove the instance from the domain during the next scheduled maintenance window.
+  **failed** – A configuration problem has prevented the instance from joining the domain. Check and fix your configuration before reissuing the instance modify command.
+  **removing** – The instance is being removed from the domain.

A request to become a member of a domain can fail because of a network connectivity issue or an incorrect IAM role. For example, you might create a DB instance or modify an existing instance and have the attempt fail for the DB instance to become a member of a domain. In this case, either reissue the command to create or modify the DB instance or modify the newly created instance to join the domain.

# Troubleshooting Active Directory
<a name="custom-sqlserver-WinAuth.Troubleshoot"></a>

The following are issues you might encounter when you set up or modify an AD.


| Error Code | Description | Common causes | Troubleshooting suggestions | 
| --- | --- | --- | --- | 
| Error 2 / 0x2 | The system cannot find the file specified. | The format or location for the Organizational Unit (OU) specified with the `—domain-ou` parameter is invalid. The domain service account specified via AWS Secrets Manager lack the permissions required to join the OU. | Review the `—domain-ou` parameter. Ensure the domain service account has the correct permissions to the OU. | 
| Error 5 / 0x5 | Access is denied. | Misconfigured permissions for the domain service account, or the computer account already exists in the domain. | Review the domain service account permissions in the domain, and verify that the RDS computer account is not duplicated in the domain. You can verify the name of the RDS computer account by running `SELECT @@SERVERNAME` on your RDS Custom for SQL Server DB instance. If you are using Multi-AZ, try rebooting with failover and then verify that the RDS computer account again. For more information, see [Rebooting a DB instance](USER_RebootInstance.md). | 
| Error 87 / 0x57 | The parameter is incorrect. | The domain service account specified via AWS Secrets Manager doesn't have the correct permissions. The user profile may also be corrupted. | Review the requirements for the domain service account. | 
| Error 234 / 0xEA | Specified Organizational Unit (OU) does not exist. | The OU specified with the `—domain-ou` parameter doesn't exist in your AD. | Review the `—domain-ou` parameter and ensure the specified OU exists in your AD. | 
| Error 1326 / 0x52E | The user name or password is incorrect. | The domain service account credentials provided in AWS Secrets Manager contains an unknown username or bad password. The domain account may also be disabled in your AD. | Ensure the credentials provided in AWS Secrets Manager are correct and the domain account is enabled in your Active Directory. | 
| Error 1355 / 0x54B | The specified domain either does not exist or could not be contacted. | The domain is down, the specified set of DNS IPs are unreachable, or the specified FQDN is unreachable. | Review the `—domain-dns-ips` and `—domain-fqdn` parameters to ensure they're correct. Review the networking configuration of your RDS Custom for SQL Server DB instance and ensure your AD is reachable. | 
| Error 1722 / 0x6BA | The RPC server is unavailable. | There was an issue reaching the RPC service of your AD domain. This might be a service or network issue. | Validate that the RPC service is running on your domain controllers and that the TCP ports `135` and `49152-65535` are reachable on your domain from your RDS Custom for SQL Server DB instance. | 
| Error 2224 / 0x8B0 | The user account already exists. | The computer account that's attempting to be added to your AD already exists. | Identify the computer account by running `SELECT @@SERVERNAME` on your RDS Custom for SQL Server DB instance and then carefully remove it from your AD. | 
| Error 2242 / 0x8c2 | The password of this user has expired. | The password for the domain service account specified via AWS Secrets Manager has expired. | Update the password for the domain service account used to join your RDS Custom for SQL Server DB instance to your AD. | 

# Managing a Multi-AZ deployment for RDS Custom for SQL Server
<a name="custom-sqlserver-multiaz"></a>

 In a Multi-AZ DB instance deployment for RDS Custom for SQL Server, Amazon RDS automatically provisions and maintains a synchronous standby replica in a different Availability Zone (AZ). The primary DB instance is synchronously replicated across Availability Zones to a standby replica to provide data redundancy.

**Important**  
A Multi-AZ deployment for RDS Custom for SQL Server is different than Multi-AZ for RDS for SQL Server. Unlike Multi-AZ for RDS for SQL Server, you must set up prerequisites for RDS Custom for SQL Server before creating your Multi-AZ DB instance because RDS Custom runs inside your own account, which requires permissions.  
If you don't complete the prerequisites, your Multi-AZ DB instance might fail to run, or automatically revert to a Single-AZ DB instance. For more information about prerequisites, see [Prerequisites for a Multi-AZ deployment with RDS Custom for SQL Server](custom-sqlserver-multiaz.prerequisites.md).

Running a DB instance with high availability can enhance availability during planned system maintenance. In the event of planned database maintenance or unplanned service disruption, Amazon RDS automatically fails over to the up-to-date secondary DB instance. This functionality lets database operations resume quickly without manual intervention. The primary and standby instances use the same endpoint, whose physical network address transitions to the secondary replica as part of the failover process. You don't have to reconfigure your application when a failover occurs.

![\[RDS Custom for SQL Server supports Multi-AZ.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/custom-sqlserver-multiaz-architecture.png)


You can create an RDS Custom for SQL Server Multi-AZ deployment by specifying Multi-AZ when creating an RDS Custom DB instance. You can use the console to convert existing RDS Custom for SQL Server DB instances to Multi-AZ deployments by modifying the DB instance and specifying the Multi-AZ option. You can also specify a Multi-AZ DB instance deployment with the AWS CLI or Amazon RDS API.

The RDS console shows the Availability Zone of the standby replica (the secondary AZ). You can also use the `describe-db-instances` CLI command or the `DescribeDBInstances` API operation to find the secondary AZ.

RDS Custom for SQL Server DB instances with Multi-AZ deployment can have increased write and commit latency compared to a Single-AZ deployment. This increase can happen because of the synchronous data replication between DB instances. You might have a change in latency if your deployment fails over to the standby replica, although AWS is engineered with low-latency network connectivity between Availability Zones.

**Note**  
For production workloads, we recommend that you use a DB instance class with Provisioned IOPS (input/output operations per second) for fast, consistent performance. For more information about DB instance classes, see [Requirements and limitations for Amazon RDS Custom for SQL Server](custom-reqs-limits-MS.md).

**Topics**
+ [

## Region and version availability
](#custom-sqlserver-multiaz.regionversion)
+ [

## Limitations for a Multi-AZ deployment with RDS Custom for SQL Server
](#custom-sqlserver-multiaz.limitations)
+ [

# Prerequisites for a Multi-AZ deployment with RDS Custom for SQL Server
](custom-sqlserver-multiaz.prerequisites.md)
+ [

## Creating an RDS Custom for SQL Server Multi-AZ deployment
](#custom-sqlserver-multiaz.creating)
+ [

# Modifying an RDS Custom for SQL Server Single-AZ deployment to a Multi-AZ deployment
](custom-sqlserver-multiaz.modify-saztomaz.md)
+ [

# Modifying an RDS Custom for SQL Server Multi-AZ deployment to a Single-AZ deployment
](custom-sqlserver-multiaz.modify-maztosaz.md)
+ [

# Failover process for an RDS Custom for SQL Server Multi-AZ deployment
](custom-sqlserver-multiaz.failover.md)

## Region and version availability
<a name="custom-sqlserver-multiaz.regionversion"></a>

Multi-AZ deployments for RDS Custom for SQL Server are supported for the following SQL Server editions:
+ SQL Server 2022 and 2019: Enterprise, Standard, Web, and Developer Edition

**Note**  
Multi-AZ deployments for RDS Custom for SQL Server aren't supported on SQL Server 2019 CU8 (15.00.4073.23) or lower versions.

Multi-AZ deployments for RDS Custom for SQL Server are available in all Regions where RDS Custom for SQL Server is available. For more information on Region availability of Multi-AZ deployments for RDS Custom for SQL Server, see [Supported Regions and DB engines for RDS Custom for SQL Server](Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.md#Concepts.RDS_Fea_Regions_DB-eng.Feature.RDSCustom.sq).

## Limitations for a Multi-AZ deployment with RDS Custom for SQL Server
<a name="custom-sqlserver-multiaz.limitations"></a>

Multi-AZ deployments with RDS Custom for SQL Server have the following limitations:
+ Cross-Region Multi-AZ deployments aren't supported.
+ You can’t configure the secondary DB instance to accept database read activity.
+ When you use a Custom Engine Version (CEV) with a Multi-AZ deployment, your secondary DB instance will also use the same CEV. The secondary DB instance can't use a different CEV. 

# Prerequisites for a Multi-AZ deployment with RDS Custom for SQL Server
<a name="custom-sqlserver-multiaz.prerequisites"></a>

If you have an existing RDS Custom for SQL Server Single-AZ deployment, the following additional prerequisites are required before modifying it to a Multi-AZ deployment. You can choose to complete the prerequisites manually or with the provided CloudFormation template. The latest CloudFormation template contains the prerequisites for both Single-AZ and Multi-AZ deployments.

**Important**  
To simplify setup, we recommend that you use the latest CloudFormation template file provided in the network setup instructions to create the prerequisites. For more information, see [Configuring with CloudFormation](custom-setup-sqlserver.md#custom-setup-sqlserver.cf).

**Note**  
When you modify an existing RDS Custom for SQL Server Single-AZ deployment to a Multi-AZ deployment, you must complete these prerequisites. If you don't complete the prerequisites, the Multi-AZ setup will fail. To complete the prerequisites, follow the steps in [Modifying an RDS Custom for SQL Server Single-AZ deployment to a Multi-AZ deployment](custom-sqlserver-multiaz.modify-saztomaz.md).
+ Update the RDS security group inbound and outbound rules to allow port 1120.
+ Add a rule in your private network Access Control List (ACL) that allows TCP ports `0-65535` for the DB instance VPC.
+ Create new Amazon SQS VPC endpoints that allow the RDS Custom for SQL Server DB instance to communicate with SQS.
+ Update the SQS permissions in the instance profile role.

## Creating an RDS Custom for SQL Server Multi-AZ deployment
<a name="custom-sqlserver-multiaz.creating"></a>

To create an RDS Custom for SQL Server Multi-AZ deployment, follow the steps in [Creating and connecting to a DB instance for Amazon RDS Custom for SQL Server](custom-creating-sqlserver.md).

**Important**  
To simplify setup, we recommend that you use the latest CloudFormation template file provided in the network setup instructions. For more information, see [Configuring with CloudFormation](custom-setup-sqlserver.md#custom-setup-sqlserver.cf).

Creating a Multi-AZ deployment takes a few minutes to complete.

# Modifying an RDS Custom for SQL Server Single-AZ deployment to a Multi-AZ deployment
<a name="custom-sqlserver-multiaz.modify-saztomaz"></a>

You can modify an existing RDS Custom for SQL Server DB instance from a Single-AZ deployment to a Multi-AZ deployment. When you modify the DB instance,Amazon RDS performs several actions:
+ Takes a snapshot of the primary DB instance.
+ Creates new volumes for the standby replica from the snapshot. These volumes initialize in the background, and maximum volume performance is achieved after the data is fully initialized.
+ Turns on synchronous block-level replication between the primary and secondary DB instances.

**Important**  
We recommend that you avoid modifying your RDS Custom for SQL Server DB instance from a Single-AZ to a Multi-AZ deployment on a production DB instance during periods of peak activity.

AWS uses a snapshot to create the standby instance to avoid downtime when you convert from Single-AZ to Multi-AZ, but performance might be impacted during and after converting to Multi-AZ. This impact can be significant for workloads that are sensitive to write latency. While this capability allows large volumes to quickly be restored from snapshots, it can cause increase in the latency of I/O operations because of the synchronous replication. This latency can impact your database performance.

**Note**  
If you created your RDS Custom for SQL Server DB instance before 29 August, 2024, patch to the latest minor version before modifying.  
For SQL Server 2019 instances, upgrade the DB engine version to `15.00.4410.1.v1` or higher.
For SQL Server 2022 instances, upgrade the DB engine version to `16.00.4150.1.v1` or higher.

**Topics**
+ [

## Configuring prerequisites to modify a Single-AZ to a Multi-AZ deployment using CloudFormation
](#custom-sqlserver-multiaz.modify-saztomaz-prereqs.cf)
+ [

## Configuring prerequisites to modify a Single-AZ to a Multi-AZ deployment manually
](#custom-sqlserver-multiaz.modify-saztomaz-prereqs.manual)
+ [

## Modify using the RDS console, AWS CLI, or RDS API.
](#custom-sqlserver-multiaz.modify-saztomaz-afterprereqs)

## Configuring prerequisites to modify a Single-AZ to a Multi-AZ deployment using CloudFormation
<a name="custom-sqlserver-multiaz.modify-saztomaz-prereqs.cf"></a>

To use a Multi-AZ deployment, you must ensure you've applied the latest CloudFormation template with prerequisites, or manually configure the latest prerequisites. If you've already applied the latest CloudFormation prerequisite template, you can skip these steps.

To configure the RDS Custom for SQL Server Multi-AZ deployment prerequisites using CloudFormation

1. Open the CloudFormation console at [https://console.aws.amazon.com/cloudformation](https://console.aws.amazon.com/cloudformation/).

1. To start the Create Stack wizard, select the existing stack you used to create a Single-AZ deployment and choose** Update**.

   The **Update stack** page appears.

1. For **Prerequisite - Prepare template**, choose **Replace current template**.

1. For **Specify template**, do the following:

   1. Download the latest CloudFormation template file. Open the context (right-click) menu for the link [custom-sqlserver-onboard.zip](samples/custom-sqlserver-onboard.zip) and choose **Save Link As**.

   1. Save and extract the `custom-sqlserver-onboard.json` file to your computer.

   1. For **Template source**, choose **Upload a template file**.

   1. For **Choose file**, navigate to and then choose `custom-sqlserver-onboard.json`.

1. Choose **Next**.

   The **Specify stack details** page appears.

1. To keep the default options, choose **Next**.

   The **Advanced Options** page appears.

1. To keep the default options, choose **Next**.

1. To keep the default options, choose **Next**.

1. On the **Review Changes** page, do the following:

   1. For **Capabilities**, select the ****I acknowledge that CloudFormation might create IAM resources with custom names**** check box.

   1. Choose **Submit**.

1. Verify the update is successful. The status of a successful operation shows `UPDATE_COMPLETE`.

If the update fails, any new configuration specified in the update process will be rolled back. The existing resource will still be usable. For example, if you add network ACL rules numbered 18 and 19, but there were existing rules with same numbers, the update would return the following error: `Resource handler returned message: "The network acl entry identified by 18 already exists.` In this scenario you can modify the existing ACL rules to use a number lower than 18, then retry the update.

## Configuring prerequisites to modify a Single-AZ to a Multi-AZ deployment manually
<a name="custom-sqlserver-multiaz.modify-saztomaz-prereqs.manual"></a>

**Important**  
To simplify setup, we recommend that you use the latest CloudFormation template file provided in the network setup instructions. For more information, see [Configuring prerequisites to modify a Single-AZ to a Multi-AZ deployment using CloudFormation](#custom-sqlserver-multiaz.modify-saztomaz-prereqs.cf).

If you choose to configure the prerequisites manually, perform the following tasks.

1. Open the Amazon VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. Choose **Endpoint**. The **Create Endpoint** page appears.

1. For **Service Category**, choose **AWS services**.

1. In **Services**, search for *SQS*

1. In **VPC**, choose the VPC where your RDS Custom for SQL Server DB instance is deployed.

1. In **Subnets**, choose the subnets where your RDS Custom for SQL Server DB instance is deployed.

1. In **Security Groups**, choose the *-vpc-endpoint-sg* group.

1. For **Policy**, choose **Custom**

1. In your custom policy, replace the *AWS partition*, *Region*, *accountId*,and *IAM-Instance-role* with your own values.

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Condition": {
                   "StringLike": {
                       "aws:ResourceTag/AWSRDSCustom": "custom-sqlserver"
                   }
               },
               "Action": [
                   "SQS:SendMessage",
                   "SQS:ReceiveMessage",
                   "SQS:DeleteMessage",
                   "SQS:GetQueueUrl"
               ],
               "Resource": "arn:aws:sqs:us-east-1:111122223333:do-not-delete-rds-custom-*",
               "Effect": "Allow",
               "Principal": {
                   "AWS": "arn:aws:iam::111122223333:role/{IAM-Instance-role}"
               }
           }
       ]
   }
   ```

------

1.  Update the **Instance profile** with permission to access Amazon SQS. Replace the *AWS partition*, *Region*, and *accountId* with your own values.

   ```
                           {
       "Sid": "SendMessageToSQSQueue",
       "Effect": "Allow",
       "Action": [
         "SQS:SendMessage",
         "SQS:ReceiveMessage",
         "SQS:DeleteMessage",                                    
         "SQS:GetQueueUrl"
   
       ],
       "Resource": [
         {
           "Fn::Sub": "arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:do-not-delete-rds-custom-*"
         }
       ],
       "Condition": {
         "StringLike": {
           "aws:ResourceTag/AWSRDSCustom": "custom-sqlserver"
         }
       }
     } 
                           >
   ```

1. Update the Amazon RDS security group inbound and outbound rules to allow port 1120.

   1. In **Security Groups**, choose the *-rds-custom-instance-sg* group.

   1. For **Inbound Rules**, create a **Custom TCP** rule to allow port *1120* from the source *-rds-custom-instance-sg* group.

   1. For **Outbound Rules**, create a **Custom TCP** rule to allow port *1120* to the destination *-rds-custom-instance-sg* group.

1. Add a rule in your private network Access Control List (ACL) that allows TCP ports `0-65535` for the source subnet of the DB instance.
**Note**  
When creating an **Inbound Rule** and **Outbound Rule**, take note of the highest existing **Rule number**. The new rules you create must have a **Rule number** lower than 100 and not match any existing **Rule number**.

   1. In **Network ACLs**, choose the *-private-network-acl* group.

   1. For **Inbound Rules**, create an **All TCP** rule to allow TCP ports `0-65535` with a source from *privatesubnet1* and *privatesubnet2*.

   1. For **Outbound Rules**, create an **All TCP** rule to allow TCP ports `0-65535` to destination *privatesubnet1* and *privatesubnet2*.

## Modify using the RDS console, AWS CLI, or RDS API.
<a name="custom-sqlserver-multiaz.modify-saztomaz-afterprereqs"></a>

After you've completed the prerequisites, you can modify an RDS Custom for SQL Server DB instance from a Single-AZ to Multi-AZ deployment using the RDS console, AWS CLI, or RDS API.

### Console
<a name="custom-sqlserver-multiaz.modify-saztomaz.Console"></a>

**To modify an existing RDS Custom for SQL Server Single-AZ to Multi-AZ deployment**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the Amazon RDS console, choose **Databases**.

   The **Databases** pane appears.

1. Choose the RDS Custom for SQL Server DB instance that you want to modify.

1. For **Actions**, choose **Convert to Multi-AZ deployment**.

1. On the **Confirmation** page, choose **Apply immediately** to apply the changes immediately. Choosing this option doesn't cause downtime, but there is a possible performance impact. Alternatively, you can choose to apply the update during the next maintenance window. For more information, see [Using the schedule modifications setting](USER_ModifyInstance.ApplyImmediately.md).

1. On the **Confirmation** page, choose **Convert to Multi-AZ**.

### AWS CLI
<a name="custom-sqlserver-multiaz.modify-saztomaz.CLI"></a>

To convert to a Multi-AZ DB instance deployment by using the AWS CLI, call the [modify-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) command and set the `--multi-az` option. Specify the DB instance identifier and the values for other options that you want to modify. For information about each option, see [Settings for DB instances](USER_ModifyInstance.Settings.md). 

**Example**  
The following code modifies `mycustomdbinstance` by including the `--multi-az` option. The changes are applied during the next maintenance window by using `--no-apply-immediately`. Use `--apply-immediately` to apply the changes immediately. For more information, see [Using the schedule modifications setting](USER_ModifyInstance.ApplyImmediately.md).   
For Linux, macOS, or Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier mycustomdbinstance \
    --multi-az \
    --no-apply-immediately
```
For Windows:  

```
aws rds modify-db-instance ^
    --db-instance-identifier mycustomdbinstance ^
    --multi-az  \ ^
    --no-apply-immediately
```

### RDS API
<a name="custom-sqlserver-multiaz.modify-saztomaz.API"></a>

To convert to a Multi-AZ DB instance deployment with the RDS API, call the [ModifyDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html) operation and set the `MultiAZ` parameter to true.

# Modifying an RDS Custom for SQL Server Multi-AZ deployment to a Single-AZ deployment
<a name="custom-sqlserver-multiaz.modify-maztosaz"></a>

You can modify an existing RDS Custom for SQL Server DB instance from a Multi-AZ to a Single-AZ deployment. 

## Console
<a name="custom-sqlserver-multiaz.modify-maztosaz.Console"></a>

**To modify an RDS Custom for SQL Server DB instance from a Multi-AZ to Single-AZ deployment.**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the Amazon RDS console, choose **Databases**.

   The **Databases** pane appears.

1. Choose the RDS Custom for SQL Server DB instance that you want to modify.

1. For **Multi-AZ deployment**, choose **No**.

1. On the **Confirmation** page, choose **Apply immediately** to apply the changes immediately. Choosing this option doesn't cause downtime, but there is a possible performance impact. Alternatively, you can choose to apply the update during the next maintenance window. For more information, see [Using the schedule modifications setting](USER_ModifyInstance.ApplyImmediately.md).

1. On the **Confirmation** page, choose **Modify DB Instance**.

## AWS CLI
<a name="custom-sqlserver-multiaz.modify-maztosaz.CLI"></a>

To modify a Multi-AZ deployment to a Single-AZ deployment by using the AWS CLI, call the [modify-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) command and include the `--no-multi-az` option. Specify the DB instance identifier and the values for other options that you want to modify. For information about each option, see [Settings for DB instances](USER_ModifyInstance.Settings.md). 

**Example**  
The following code modifies `mycustomdbinstance` by including the `--no-multi-az` option. The changes are applied during the next maintenance window by using `--no-apply-immediately`. Use `--apply-immediately` to apply the changes immediately. For more information, see [Using the schedule modifications setting](USER_ModifyInstance.ApplyImmediately.md).   
For Linux, macOS, or Unix:  

```
aws rds modify-db-instance \
    --db-instance-identifier mycustomdbinstance \
    --no-multi-az  \
    --no-apply-immediately
```
For Windows:  

```
aws rds modify-db-instance ^
    --db-instance-identifier mycustomdbinstance ^
    --no-multi-az \ ^
    --no-apply-immediately
```

## RDS API
<a name="custom-sqlserver-multiaz.modify-maztosaz.API"></a>

To modify a Multi-AZ deployment to a Single-AZ deployment by using the RDS API, call the [ModifyDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html) operation and set the `MultiAZ` parameter to `false`.

# Failover process for an RDS Custom for SQL Server Multi-AZ deployment
<a name="custom-sqlserver-multiaz.failover"></a>

If a planned or unplanned outage of your DB instance results from an infrastructure defect, Amazon RDS automatically switches to a standby replica in another Availability Zone if you have turned on Multi-AZ. The time that it takes for the failover to complete depends on the database activity and other conditions at the time that the primary DB instance became unavailable. Failover times are typically 60 – 120 seconds. However, large transactions or a lengthy recovery process can increase failover time. When the failover is complete, it can take additional time for the RDS console to show the new Availability Zone.

**Note**  
You can force a failover manually when you reboot a DB instance with failover. For more information on rebooting a DB instance, see [Rebooting a DB instance](USER_RebootInstance.md) 

Amazon RDS handles failovers automatically so you can resume database operations as quickly as possible without administrative intervention. The primary DB instance switches over automatically to the standby replica if any of the conditions described in the following table occurs. You can view these failover reasons in the RDS event log.


****  

| Failover reason | Description | 
| --- | --- | 
| `The operating system for the RDS Custom for SQL Server Multi-AZ DB instance is being patched in an offline operation` | A failover was triggered during the maintenance window for an OS patch or a security update. For more information, see [Maintaining a DB instance](USER_UpgradeDBInstance.Maintenance.md).  | 
| `The primary host of the RDS Custom for SQL Server Multi-AZ DB instance is unhealthy.` | The Multi-AZ DB instance deployment detected an impaired primary DB instance and failed over. | 
| `The primary host of the RDS Custom for SQL Server Multi-AZ DB instance is unreachable due to loss of network connectivity.` | RDS monitoring detected a network reachability failure to the primary DB instance and triggered a failover. | 
| `The RDS Custom for SQL Server Multi-AZ DB instance was modified by the customer.` | A DB instance modification triggered a failover. For more information, see [Modifying an RDS Custom for SQL Server DB instance](custom-managing.modify-sqlserver.md).  | 
| `The storage volume of the primary host of the RDS Custom for SQL Server Multi-AZ DB instance experienced a failure.` | The Multi-AZ DB instance deployment detected a storage issue on the primary DB instance and failed over. | 
| `The user requested a failover of the RDS Custom for SQL Server Multi-AZ DB instance.` | The RDS Custom for SQL Server Multi-AZ DB instance was rebooted with failover. For more information, see [Rebooting a DB instance](USER_RebootInstance.md). | 
| `The RDS Custom for SQL Server Multi-AZ primary DB instance is busy or unresponsive.` | The primary DB instance is unresponsive. We recommend that you try the following steps:  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-sqlserver-multiaz.failover.html)  | 

To determine if your Multi-AZ DB instance has failed over, you can do the following:
+ Set up DB event subscriptions to notify you by email or SMS that a failover has been initiated. For more information about events, see [Working with Amazon RDS event notification](USER_Events.md).
+ View your DB events by using the RDS console or API operations.
+ View the current state of your RDS Custom for SQL Server Multi-AZ DB instance deployment by using the RDS console, CLI, or API operations.

## Time to live (TTL) settings with applications using an RDS Custom for SQL Server Multi-AZ deployment
<a name="custom-sqlserver-multiaz.ttldns"></a>

The failover mechanism automatically changes the Domain Name System (DNS) record of the DB instance to point to the standby DB instance. As a result, you need to re-establish any existing connections to your DB instance. Ensure that any DNS cache time-to-live (TTL) configuration value is low, and validate that your application will not cache DNS for an extended time. A high TTL value might prevent your application from quickly reconnecting to the DB instance after failover.

# Backing up and restoring an Amazon RDS Custom for SQL Server DB instance
<a name="custom-backup-sqlserver"></a>

Like Amazon RDS, RDS Custom creates and saves automated backups of your RDS Custom for SQL Server DB instance when backup retention is enabled. You can also back up your DB instance manually. The automated backups are comprised of snapshot backups and transaction log backups. Snapshot backups are taken for the entire storage volume of DB instance during your specified backup window. Transaction log backups are taken for the PITR-eligible databases on a regular interval period. RDS Custom saves the automated backups of your DB instance according to your specified backup retention period. You can use automated backups to recover your DB instance to a point in time within the backup retention period.

You can also take snapshot backups manually. You can create a new DB instance from these snapshot backups at any time. For more information about manually creating a DB snapshot, see [Creating an RDS Custom for SQL Server snapshot](custom-backup-sqlserver.creating.md).

Although snapshot backups serve operationally as full backups, you are billed only for incremental storage use. The first snapshot of an RDS Custom DB instance contains the data for the full DB instance. Subsequent snapshots of the same database are incremental, which means that only the data that has changed after your most recent snapshot is saved. 

**Topics**
+ [

# Creating an RDS Custom for SQL Server snapshot
](custom-backup-sqlserver.creating.md)
+ [

# Restoring from an RDS Custom for SQL Server DB snapshot
](custom-backup-sqlserver.restoring.md)
+ [

# Restoring an RDS Custom for SQL Server instance to a point in time
](custom-backup.pitr-sqs.md)
+ [

# Deleting an RDS Custom for SQL Server snapshot
](custom-backup-sqlserver.deleting.md)
+ [

# Deleting RDS Custom for SQL Server automated backups
](custom-backup-sqlserver.deleting-backups.md)

# Creating an RDS Custom for SQL Server snapshot
<a name="custom-backup-sqlserver.creating"></a>

RDS Custom for SQL Server creates a storage volume snapshot of your DB instance, backing up the entire DB instance and not just individual databases. When you create a snapshot, specify which RDS Custom for SQL Server DB instance to back up. Give your snapshot a name so you can restore from it later.

When you create a snapshot, RDS Custom for SQL Server creates an Amazon EBS snapshot for volume `(D:)`, which is the database volume attached to the DB instance. To make snapshots easy to associate with a specific DB instance, they're tagged with `DBSnapshotIdentifier`, `DbiResourceId`, and `VolumeType`.

Creating a DB snapshot results in a brief I/O suspension. This suspension can last from a few seconds to a few minutes, depending on the size and class of your DB instance. The snapshot creation time varies with the total count and size of your databases. To learn more about the number of databases eligible for a point in time restore (PITR) operation, see [Number of databases eligible for PITR per instance class type](custom-backup.pitr-sqs.md#custom-backup.pitr.sqlserver.eligiblecountperinstance).

Because the snapshot includes the entire storage volume, the size of files, such as temporary files, also affects snapshot creation time. To learn more about creating snapshots, see [Creating a DB snapshot for a Single-AZ DB instance for Amazon RDS](USER_CreateSnapshot.md).

Create an RDS Custom for SQL Server snapshot using the console or the AWS CLI.

## Console
<a name="USER_CreateSnapshot-sqlserver.CON"></a>

**To create an RDS Custom snapshot**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Databases**.

1. In the list of RDS Custom DB instances, choose the instance for which you want to take a snapshot.

1. For **Actions**, choose **Take snapshot**.

   The **Take DB snapshot** window appears.

1. For **Snapshot name**, enter the name of the snapshot.

1. Choose **Take snapshot**.

## AWS CLI
<a name="USER_CreateSnapshot-sqlserver.CLI"></a>

You create a snapshot of an RDS Custom DB instance by using the [create-db-snapshot](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-snapshot.html) AWS CLI command.

Specify the following options:
+ `--db-instance-identifier` – Identifies which RDS Custom DB instance you are going to back up
+ `--db-snapshot-identifier` – Names your RDS Custom snapshot so you can restore from it later

In this example, you create a DB snapshot called *`my-custom-snapshot`* for an RDS Custom DB instance called `my-custom-instance`.

**Example**  
For Linux, macOS, or Unix:  

```
1. aws rds create-db-snapshot \
2.     --db-instance-identifier my-custom-instance \
3.     --db-snapshot-identifier my-custom-snapshot
```
For Windows:  

```
1. aws rds create-db-snapshot ^
2.     --db-instance-identifier my-custom-instance ^
3.     --db-snapshot-identifier my-custom-snapshot
```

# Restoring from an RDS Custom for SQL Server DB snapshot
<a name="custom-backup-sqlserver.restoring"></a>

When you restore an RDS Custom for SQL Server DB instance, you provide the name of the DB snapshot and a name for the new instance. You can't restore from a snapshot to an existing RDS Custom DB instance. A new RDS Custom for SQL Server DB instance is created when you restore.

Restoring from a snapshot will restore the storage volume to the point in time at which the snapshot was taken. This will include all the databases and any other files that were present on the `(D:)` volume.

## Console
<a name="custom-backup-sqlserver.restoring.console"></a>

**To restore an RDS Custom DB instance from a DB snapshot**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Snapshots**.

1. Choose the DB snapshot that you want to restore from.

1. For **Actions**, choose **Restore snapshot**.

1. On the **Restore DB instance** page, for **DB instance identifier**, enter the name for your restored RDS Custom DB instance.

1. Choose **Restore DB instance**. 

## AWS CLI
<a name="custom-backup-sqlserver.restoring.CLI"></a>

You restore an RDS Custom DB snapshot by using the [ restore-db-instance-from-db-snapshot](https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-from-db-snapshot.html) AWS CLI command.

If the snapshot you are restoring from is for a private DB instance, make sure to specify both the correct `db-subnet-group-name` and `no-publicly-accessible`. Otherwise, the DB instance defaults to publicly accessible. The following options are required:
+ `db-snapshot-identifier` – Identifies the snapshot from which to restore
+ `db-instance-identifier` – Specifies the name of the RDS Custom DB instance to create from the DB snapshot
+ `custom-iam-instance-profile` – Specifies the instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.

The following code restores the snapshot named `my-custom-snapshot` for `my-custom-instance`.

**Example**  
For Linux, macOS, or Unix:  

```
aws rds restore-db-instance-from-db-snapshot \
  --db-snapshot-identifier my-custom-snapshot \
  --db-instance-identifier my-custom-instance \
  --custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance \
  --no-publicly-accessible
```
For Windows:  

```
aws rds restore-db-instance-from-db-snapshot ^
  --db-snapshot-identifier my-custom-snapshot ^
  --db-instance-identifier my-custom-instance ^
  --custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance ^
  --no-publicly-accessible
```

# Restoring an RDS Custom for SQL Server instance to a point in time
<a name="custom-backup.pitr-sqs"></a>

You can restore a DB instance to a specific point in time (PITR), creating a new DB instance. To support PITR, your DB instances must have backup retention enabled.

The latest restorable time for an RDS Custom for SQL Server DB instance depends on several factors, but is typically within 5 minutes of the current time. To see the latest restorable time for a DB instance, use the AWS CLI [describe-db-instances](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-instances.html) command and look at the value returned in the `LatestRestorableTime` field for the DB instance. To see the latest restorable time for each DB instance in the Amazon RDS console, choose **Automated backups**.

You can restore to any point in time within your backup retention period. To see the earliest restorable time for each DB instance, choose **Automated backups** in the Amazon RDS console.

For general information about PITR, see [Restoring a DB instance to a specified time for Amazon RDS](USER_PIT.md).

**Topics**
+ [

## PITR considerations for RDS Custom for SQL Server
](#custom-backup.pitr.sqlserver)
+ [

## Number of databases eligible for PITR per instance class type
](#custom-backup.pitr.sqlserver.eligiblecountperinstance)
+ [

## Making databases ineligible for PITR
](#custom-backup.pitr.sqlserver.ineligible)
+ [

## Transaction logs in Amazon S3
](#custom-backup.pitr.sqlserver.tlogs)
+ [

## PITR Restore using the AWS Management Console, the AWS CLI, or the RDS API.
](#custom-backup.pitr-sqs-concli)

## PITR considerations for RDS Custom for SQL Server
<a name="custom-backup.pitr.sqlserver"></a>

In RDS Custom for SQL Server, PITR differs in the following important ways from PITR in Amazon RDS:
+ PITR only restores the databases in the DB instance. It doesn't restore the operating system or files on the C: drive.
+ For an RDS Custom for SQL Server DB instance, a database is backed up automatically and is eligible for PITR only under the following conditions:
  + The database is online.
  + Its recovery model is set to `FULL`.
  + It's writable.
  + It has its physical files on the D: drive.
  + It's not listed in the `rds_pitr_blocked_databases` table. For more information, see [Making databases ineligible for PITR](#custom-backup.pitr.sqlserver.ineligible).
+ The databases eligible for PITR are determined by the order of their database ID. RDS Custom for SQL Server allows up to 5,000 databases per DB instance. However, the maximum number of databases restored by a PITR operation for an RDS Custom for SQL Server DB instance is dependent on the instance class type. For more information, see [Number of databases eligible for PITR per instance class type](#custom-backup.pitr.sqlserver.eligiblecountperinstance).

  Other databases that aren't part of PITR can be restored from DB snapshots, including the automated snapshot backups used for PITR.
+ Adding a new database, renaming a database, or restoring a database that is eligible for PITR initiates a snapshot of the DB instance.
+ The maximum number of databases eligible for PITR changes when the database instance goes through a scale compute operation, depending on the target instance class type. If the instance is scaled up, allowing more databases on the instance to be eligible for PITR, a new snapshot is taken.
+ Restored databases have the same name as in the source DB instance. You can't specify a different name.
+ `AWSRDSCustomSQLServerIamRolePolicy` requires access to other AWS services. For more information, see [Add an access policy to AWSRDSCustomSQLServerInstanceRole](custom-setup-sqlserver.md#custom-setup-sqlserver.iam.add-policy).
+ Time zone changes aren't supported for RDS Custom for SQL Server. If you change the operating system or DB instance time zone, PITR (and other automation) doesn't work.

## Number of databases eligible for PITR per instance class type
<a name="custom-backup.pitr.sqlserver.eligiblecountperinstance"></a>

The following table shows the maximum number of databases eligible for PITR based on instance class type.


| Instance class type | Maximum number of PITR eligible databases | 
| --- | --- | 
| db.\$1.large | 100 | 
| db.\$1.xlarge to db.\$1.2xlarge | 150 | 
| db.\$1.4xlarge to db.\$1.8xlarge | 300 | 
| db.\$1.12xlarge to db.\$1.16xlarge | 600 | 
| db.\$1.24xlarge, db.\$132xlarge | 1000 | 

`*` *Represents different instance class types.*

The maximum number of databases eligible for PITR on a DB instance depends on the instance class type. The number ranges from 100 on the smallest to 1000 on the largest instance class types supported by RDS Custom for SQL Server. SQL server system databases `(master, model, msdb, tempdb)`, aren't included in this limit. When a DB instance is scaled up or down, depending on the target instance class type, RDS Custom will automatically update the number of database eligible for PITR. RDS Custom for SQL Server will send `RDS-EVENT-0352` when the maximum number of databases eligible for PITR changes on a DB instance. For more information, see [Custom engine version events](USER_Events.Messages.md#USER_Events.Messages.CEV).

**Note**  
PITR support for greater than 100 databases is only available on DB instances created after August 26, 2023. For instances created before August 26, 2023, the maximum number of databases eligible for PITR is 100, regardless of the instance class. To enable PITR support for more than 100 databases on DB instances created before August 26, 2023, you can perform the following action:  
Upgrade the DB engine version to 15.00.4322.2.v1 or higher

During a PITR operation, RDS Custom will restore all of the databases that were part of PITR on source DB instance at restore time. Once the target DB instance has completed restore operations, if backup retention is enabled, the DB instance will start backing up based on the maximum number of databases eligible for PITR on target DB instance.

For example, if your DB instance runs on a `db.*.xlarge` that has 200 databases:

1. RDS Custom for SQL Server will choose the first 150 databases, ordered by their database ID, for PITR backup.

1. You modify the instance to scale up to db.\$1.4xlarge.

1. Once the scale compute operation is completed, RDS Custom for SQL Server will choose the first 300 databases, ordered by their database ID, for PITR backup. Each one of the 200 databases that satisfy the PITR requirement conditions will now be eligible for PITR.

1. You now modify the instance to scale down back to db.\$1.xlarge.

1. Once the scale compute operation is completed, RDS Custom for SQL Server will again select the first 150 databases, ordered by their database ID, for PITR backup.

## Making databases ineligible for PITR
<a name="custom-backup.pitr.sqlserver.ineligible"></a>

You can choose to exclude individual databases from PITR. To do this, put their `database_id` values into a `rds_pitr_blocked_databases` table. Use the following SQL script to create the table.

**To create the rds\$1pitr\$1blocked\$1databases table**
+ Run the following SQL script.

  ```
  create table msdb..rds_pitr_blocked_databases
  (
  database_id INT NOT NULL,
  database_name SYSNAME NOT NULL,
  db_entry_updated_date datetime NOT NULL DEFAULT GETDATE(),
  db_entry_updated_by SYSNAME NOT NULL DEFAULT CURRENT_USER,
  PRIMARY KEY (database_id)
  );
  ```

For the list of eligible and ineligible databases, see the `RI.End` file in the `RDSCustomForSQLServer/Instances/DB_instance_resource_ID/TransactionLogMetadata` directory in the Amazon S3 bucket `do-not-delete-rds-custom-$ACCOUNT_ID-$REGION-unique_identifier`. For more information about the `RI.End` file, see [Transaction logs in Amazon S3](#custom-backup.pitr.sqlserver.tlogs).

You can also determine the list of eligible databases for PITR using the following SQL script. Set the `@limit` variable to the maximum number of databases on eligible for PITR for the instance class. For more information, see [Number of databases eligible for PITR per instance class type](#custom-backup.pitr.sqlserver.eligiblecountperinstance).

**To determine the list of eligible databases for PITR on a DB instance class**
+ Run the following SQL script.

  ```
  DECLARE @Limit INT;
  SET @Limit = (insert-database-instance-limit-here);
  
  USE msdb;
  IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND  TABLE_NAME = 'rds_pitr_blocked_databases'))
      WITH TABLE0 AS (
          SELECT hdrs.database_id as DatabaseId, sdb.name as DatabaseName, 'ALWAYS_ON_NOT_WRITABLE_REPLICA' as Reason, NULL as DatabaseNameOnPitrTable
          FROM sys.dm_hadr_database_replica_states hdrs
          INNER JOIN sys.databases sdb ON sdb.database_id = hdrs.database_id
          WHERE (hdrs.is_local = 1 AND hdrs.is_primary_replica = 0) 
          OR (sys.fn_hadr_is_primary_replica (sdb.name) = 1 AND DATABASEPROPERTYEX (sdb.name, 'Updateability') = 'READ_ONLY')
      ),
      TABLE1 as (
              SELECT dbs.database_id as DatabaseId, sysdbs.name as DatabaseName, 'OPTOUT' as Reason,
              CASE WHEN dbs.database_name = sysdbs.name THEN NULL ELSE dbs.database_name END AS DatabaseNameOnPitrTable
              FROM msdb.dbo.rds_pitr_blocked_databases dbs
              INNER JOIN sys.databases sysdbs ON dbs.database_id = sysdbs.database_id
              WHERE sysdbs.database_id > 4
              ),
      TABLE2 as (
              SELECT
              db.name AS DatabaseName,
              db.create_date AS CreateDate,
              db.state_desc AS DatabaseState,
              db.database_id AS DatabaseId,
              rs.database_guid AS DatabaseGuid,
              rs.last_log_backup_lsn AS LastLogBackupLSN,
              rs.recovery_fork_guid RecoveryForkGuid,
              rs.first_recovery_fork_guid AS FirstRecoveryForkGuid,
              db.recovery_model_desc AS RecoveryModel,
              db.is_auto_close_on AS IsAutoClose,
              db.is_read_only as IsReadOnly,
              NEWID() as FileName,
              CASE WHEN(db.state_desc = 'ONLINE'
                      AND db.recovery_model_desc != 'SIMPLE' 
                      AND((db.is_auto_close_on = 0 and db.collation_name IS NOT NULL) OR db.is_auto_close_on = 1)) 
                      AND db.is_read_only != 1
                      AND db.user_access = 0
                      AND db.source_database_id IS NULL
                      AND db.is_in_standby != 1
                      THEN 1 ELSE 0 END AS IsPartOfSnapshot,
              CASE WHEN db.source_database_id IS NULL THEN 0 ELSE 1 END AS IsDatabaseSnapshot
              FROM sys.databases db
              INNER JOIN sys.database_recovery_status rs
              ON db.database_id = rs.database_id
              WHERE DB_NAME(db.database_id) NOT IN('tempdb') AND
              db.database_id NOT IN (SELECT DISTINCT DatabaseId FROM TABLE1) AND
              db.database_id NOT IN (SELECT DISTINCT DatabaseId FROM TABLE0)
          ),
          TABLE3 as(
              Select @Limit+count(DatabaseName) as TotalNumberOfDatabases from TABLE2 where TABLE2.IsPartOfSnapshot=1 and DatabaseName in ('master','model','msdb')
          )
          SELECT TOP(SELECT TotalNumberOfDatabases from TABLE3)  DatabaseName,CreateDate,DatabaseState,DatabaseId from TABLE2 where TABLE2.IsPartOfSnapshot=1
          ORDER BY TABLE2.DatabaseID ASC
  ELSE
      WITH TABLE0 AS (
          SELECT hdrs.database_id as DatabaseId, sdb.name as DatabaseName, 'ALWAYS_ON_NOT_WRITABLE_REPLICA' as Reason, NULL as DatabaseNameOnPitrTable
          FROM sys.dm_hadr_database_replica_states hdrs
          INNER JOIN sys.databases sdb ON sdb.database_id = hdrs.database_id
          WHERE (hdrs.is_local = 1 AND hdrs.is_primary_replica = 0) 
          OR (sys.fn_hadr_is_primary_replica (sdb.name) = 1 AND DATABASEPROPERTYEX (sdb.name, 'Updateability') = 'READ_ONLY')
      ),
      TABLE1 as (
              SELECT
              db.name AS DatabaseName,
              db.create_date AS CreateDate,
              db.state_desc AS DatabaseState,
              db.database_id AS DatabaseId,
              rs.database_guid AS DatabaseGuid,
              rs.last_log_backup_lsn AS LastLogBackupLSN,
              rs.recovery_fork_guid RecoveryForkGuid,
              rs.first_recovery_fork_guid AS FirstRecoveryForkGuid,
              db.recovery_model_desc AS RecoveryModel,
              db.is_auto_close_on AS IsAutoClose,
              db.is_read_only as IsReadOnly,
              NEWID() as FileName,
              CASE WHEN(db.state_desc = 'ONLINE'
                      AND db.recovery_model_desc != 'SIMPLE' 
                      AND((db.is_auto_close_on = 0 and db.collation_name IS NOT NULL) OR db.is_auto_close_on = 1)) 
                      AND db.is_read_only != 1
                      AND db.user_access = 0
                      AND db.source_database_id IS NULL
                      AND db.is_in_standby != 1
                      THEN 1 ELSE 0 END AS IsPartOfSnapshot,
              CASE WHEN db.source_database_id IS NULL THEN 0 ELSE 1 END AS IsDatabaseSnapshot
              FROM sys.databases db
              INNER JOIN sys.database_recovery_status rs
              ON db.database_id = rs.database_id
              WHERE DB_NAME(db.database_id) NOT IN('tempdb') AND
              db.database_id NOT IN (SELECT DISTINCT DatabaseId FROM TABLE0)
          ),
          TABLE2 as(
              SELECT @Limit+count(DatabaseName) as TotalNumberOfDatabases from TABLE1 where TABLE1.IsPartOfSnapshot=1 and DatabaseName in ('master','model','msdb')
          )
          select top(select TotalNumberOfDatabases from TABLE2)  DatabaseName,CreateDate,DatabaseState,DatabaseId from TABLE1 where TABLE1.IsPartOfSnapshot=1
          ORDER BY TABLE1.DatabaseID ASC
  ```

**Note**  
The databases that are only symbolic links are also excluded from databases eligible for PITR operations. The above query doesn’t filter based on this criteria.

## Transaction logs in Amazon S3
<a name="custom-backup.pitr.sqlserver.tlogs"></a>

The backup retention period determines whether transaction logs for RDS Custom for SQL Server DB instances are automatically extracted and uploaded to Amazon S3. A nonzero value means that automatic backups are created, and that the RDS Custom agent uploads the transaction logs to S3 every 5 minutes.

Transaction log files on S3 are encrypted at rest using the AWS KMS key that you provided when you created your DB instance. For more information, see [Protecting data using server-side encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html) in the *Amazon Simple Storage Service User Guide*.

The transaction logs for each database are uploaded to an S3 bucket named `do-not-delete-rds-custom-$ACCOUNT_ID-$REGION-unique_identifier`. The `RDSCustomForSQLServer/Instances/DB_instance_resource_ID` directory in the S3 bucket contains two subdirectories:
+ `TransactionLogs` – Contains the transaction logs for each database and their respective metadata.

  The transaction log file name follows the pattern `yyyyMMddHHmm.database_id.timestamp`, for example:

  ```
  202110202230.11.1634769287
  ```

  The same file name with the suffix `_metadata` contains information about the transaction log such as log sequence numbers, database name, and `RdsChunkCount`. `RdsChunkCount` determines how many physical files represent a single transaction log file. You might see files with suffixes `_0001`, `_0002`, and so on, which mean the physical chunks of a transaction log file. If you want to use a chunked transaction log file, make sure to merge the chunks after downloading them.

  Consider a scenario where you have the following files:
  + `202110202230.11.1634769287`
  + ` 202110202230.11.1634769287_0001`
  + ` 202110202230.11.1634769287_0002 `
  + ` 202110202230.11.1634769287_metadata`

  The `RdsChunkCount` is `3`. The order for merging the files is the following: `202110202230.11.1634769287`, ` 202110202230.11.1634769287_0001`, `202110202230.11.1634769287_0002`.
+ `TransactionLogMetadata` – Contains metadata information about each iteration of transaction log extraction.

  The `RI.End` file contains information for all databases that had their transaction logs extracted, and all databases that exist but didn't have their transaction logs extracted. The `RI.End` file name follows the pattern `yyyyMMddHHmm.RI.End.timestamp`, for example:

  ```
  202110202230.RI.End.1634769281
  ```

## PITR Restore using the AWS Management Console, the AWS CLI, or the RDS API.
<a name="custom-backup.pitr-sqs-concli"></a>

You can restore an RDS Custom for SQL Server DB instance to a point in time using the AWS Management Console, the AWS CLI, or the RDS API.

### Console
<a name="custom-backup-sqs.pitr2.CON"></a>

**To restore an RDS Custom DB instance to a specified time**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Automated backups**.

1. Choose the RDS Custom DB instance that you want to restore.

1. For **Actions**, choose **Restore to point in time**.

   The **Restore to point in time** window appears.

1. Choose **Latest restorable time** to restore to the latest possible time, or choose **Custom** to choose a time.

   If you chose **Custom**, enter the date and time to which you want to restore the instance.

   Times are shown in your local time zone, which is indicated by an offset from Coordinated Universal Time (UTC). For example, UTC-5 is Eastern Standard Time/Central Daylight Time.

1. For **DB instance identifier**, enter the name of the target restored RDS Custom DB instance. The name must be unique.

1. Choose other options as needed, such as DB instance class.

1. Choose **Restore to point in time**.

### AWS CLI
<a name="custom-backup-sqs.pitr2.CLI"></a>

You restore a DB instance to a specified time by using the [ restore-db-instance-to-point-in-time](https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-to-point-in-time.html) AWS CLI command to create a new RDS Custom DB instance.

Use one of the following options to specify the backup to restore from:
+ `--source-db-instance-identifier mysourcedbinstance`
+ `--source-dbi-resource-id dbinstanceresourceID`
+ `--source-db-instance-automated-backups-arn backupARN`

The `custom-iam-instance-profile` option is required.

The following example restores `my-custom-db-instance` to a new DB instance named `my-restored-custom-db-instance`, as of the specified time.

**Example**  
For Linux, macOS, or Unix:  

```
1. aws rds restore-db-instance-to-point-in-time \
2.     --source-db-instance-identifier my-custom-db-instance\
3.     --target-db-instance-identifier my-restored-custom-db-instance \
4.     --custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance \
5.     --restore-time 2022-10-14T23:45:00.000Z
```
For Windows:  

```
1. aws rds restore-db-instance-to-point-in-time ^
2.     --source-db-instance-identifier my-custom-db-instance ^
3.     --target-db-instance-identifier my-restored-custom-db-instance ^
4.     --custom-iam-instance-profile AWSRDSCustomInstanceProfileForRdsCustomInstance ^
5.     --restore-time 2022-10-14T23:45:00.000Z
```

# Deleting an RDS Custom for SQL Server snapshot
<a name="custom-backup-sqlserver.deleting"></a>

You can delete DB snapshots managed by RDS Custom for SQL Server when you no longer need them. The deletion procedure is the same for both Amazon RDS and RDS Custom DB instances.

The Amazon EBS snapshots for the binary and root volumes remain in your account for a longer time because they might be linked to some instances running in your account or to other RDS Custom for SQL Server snapshots. These EBS snapshots are automatically deleted after they're no longer related to any existing RDS Custom for SQL Server resources (DB instances or backups).

## Console
<a name="USER_DeleteSnapshot-sqlserver.CON"></a>

**To delete a snapshot of an RDS Custom DB instance**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Snapshots**.

1. Choose the DB snapshot that you want to delete.

1. For **Actions**, choose **Delete snapshot**.

1. Choose **Delete** on the confirmation page.

## AWS CLI
<a name="USER_DeleteSnapshot-sqlserver.CLI"></a>

To delete an RDS Custom snapshot, use the AWS CLI command [delete-db-snapshot](https://docs.aws.amazon.com/cli/latest/reference/rds/delete-db-snapshot.html).

The following option is required:
+ `--db-snapshot-identifier` – The snapshot to be deleted

The following example deletes the `my-custom-snapshot` DB snapshot.

**Example**  
For Linux, macOS, or Unix:  

```
1. aws rds delete-db-snapshot \  
2.   --db-snapshot-identifier my-custom-snapshot
```
For Windows:  

```
1. aws rds delete-db-snapshot ^
2.   --db-snapshot-identifier my-custom-snapshot
```

# Deleting RDS Custom for SQL Server automated backups
<a name="custom-backup-sqlserver.deleting-backups"></a>

You can delete retained automated backups for RDS Custom for SQL Server when they are no longer needed. The procedure is the same as the procedure for deleting Amazon RDS backups.

## Console
<a name="USER_WorkingWithAutomatedBackups-sqlserver-Deleting.CON"></a>

**To delete a retained automated backup**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Automated backups**.

1. Choose **Retained**.

1. Choose the retained automated backup that you want to delete.

1. For **Actions**, choose **Delete**.

1. On the confirmation page, enter **delete me** and choose **Delete**. 

## AWS CLI
<a name="USER_WorkingWithAutomatedBackups-sqlserver-Deleting.CLI"></a>

You can delete a retained automated backup by using the AWS CLI command [delete-db-instance-automated-backup](https://docs.aws.amazon.com/cli/latest/reference/rds/delete-db-instance-automated-backup.html).

The following option is used to delete a retained automated backup:
+ `--dbi-resource-id` – The resource identifier for the source RDS Custom DB instance.

  You can find the resource identifier for the source DB instance of a retained automated backup by using the AWS CLI command [describe-db-instance-automated-backups](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-instance-automated-backups.html).

The following example deletes the retained automated backup with source DB instance resource identifier `custom-db-123ABCEXAMPLE`.

**Example**  
For Linux, macOS, or Unix:  

```
1. aws rds delete-db-instance-automated-backup \
2.     --dbi-resource-id custom-db-123ABCEXAMPLE
```
For Windows:  

```
1. aws rds delete-db-instance-automated-backup ^
2.     --dbi-resource-id custom-db-123ABCEXAMPLE
```

# Copying an Amazon RDS Custom for SQL Server DB snapshot
<a name="custom-copying-snapshot-sqlserver"></a>

With RDS Custom for SQL Server, you can copy automated backups and manual DB snapshots. After copying a snapshot, the copy you create is a manual snapshot. You can make multiple copies of an automated backup or manual snapshot but each copy must have a unique identifier.

You can only copy a snapshot within the same AWS account across different AWS Regions where RDS Custom for SQL Server is available. The following operations are currently not supported:
+ Copying DB snapshots within the same AWS Region.
+ Copying DB snapshots across AWS accounts.

RDS Custom for SQL Server supports incremental snapshot copying. For more information, see [Considerations for incremental snapshot copying](USER_CopySnapshot.md#USER_CopySnapshot.Incremental).

**Topics**
+ [

## Limitations
](#custom-copying-snapshot-sqlserver.Limitations)
+ [

## Handling encryption
](#custom-copying-snapshot-sqlserver.Encryption)
+ [

## Cross-Region copying
](#custom-copying-snapshot-sqlserver.XRCopy)
+ [

## Snapshots of DB instances created with Custom Engine Versions (CEV)
](#custom-copying-snapshot-sqlserver.CEVSnap)
+ [

## Grant required permissions to your IAM principal
](#custom-copying-snapshot-sqlserver.GrantPermIAM)
+ [

## Copying a DB snapshot
](#custom-copying-snapshot-sqlserver.CopyingDBSnapshot)

## Limitations
<a name="custom-copying-snapshot-sqlserver.Limitations"></a>

The following limitations apply to copying a DB snapshot for RDS Custom for SQL Server:
+ If you delete a source snapshot before the target snapshot becomes available, the snapshot copy might fail. Verify that the target snapshot has a status of `AVAILABLE` before you delete the source snapshot.
+ You cannot specify an option group name or copy an options group in your DB snapshot copy request.
+ If you delete any dependent AWS resources of the source DB snapshot before or during the copy process, your copy snapshot request could fail asynchronously.
  + If you delete the Service Master Key (SMK) backup file for your source DB instance stored in the RDS Custom managed S3 bucket in your account, the DB snapshot copy succeeds asynchronously. However, SQL Server features dependent on SMK such as TDE enabled databases run into issues. For more information, see [Troubleshooting PENDING\$1RECOVERY state for TDE enabled databases in RDS Custom for SQL Server](custom-troubleshooting-sqlserver.md#custom-troubleshooting-sqlserver.pending_recovery).
+ Copying DB snapshots within the same AWS Region is currently not supported.
+ Copying DB snapshots across AWS accounts is currently not supported.

The limitations of copying a DB snapshot for Amazon RDS also apply to RDS Custom for SQL Server. For more information, see [Limitations](USER_CopySnapshot.md#USER_CopySnapshot.Limitations).

## Handling encryption
<a name="custom-copying-snapshot-sqlserver.Encryption"></a>

All RDS Custom for SQL Server DB instances and DB snapshots are encrypted with KMS keys. You can only copy an encrypted snapshot to an encrypted snapshot, therefore you must specify a KMS key valid in the destination AWS Region for your DB snapshot copy request.

The source snapshot remains encrypted throughout the copy process. Amazon RDS uses envelope encryption to protect data during the copy operation with the specified destination AWS Region KMS key. For more information, see [Envelope encryption](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#enveloping) in the *AWS Key Management Service Developer Guide*.

## Cross-Region copying
<a name="custom-copying-snapshot-sqlserver.XRCopy"></a>

You can copy DB snapshots across AWS Regions. However, there are certain constraints and considerations for cross-Region snapshot copying.

### Authorizing RDS to communicate across AWS Regions for snapshot copying
<a name="custom-copying-snapshot-sqlserver.XRCopy.Authorize"></a>

After a cross-Region DB snapshot copy request is processed successfully, RDS starts the copy. An authorization request for RDS to access the source snapshot is created. This authorization request links the source DB snapshot to the target DB snapshot. This allows RDS to copy only to the specified target snapshot. 

RDS verifies the authorization by using the `rds:CrossRegionCommunication` permission in the service-linked IAM role. If the copy is authorized, RDS can communicate with the source Region and complete the copy operation. 

RDS doesn’t have access to DB snapshots that weren't authorized previously by a CopyDBSnapshot request. The authorization is revoked after the copy completes.

RDS uses the service-linked role to verify the authorization in the source Region. The copy fails if you delete the service-linked role during the copy process.

For more information, see [Using service-linked roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html) in the *AWS Identity and Access Management User Guide*.

### Using AWS Security Token Service credentials
<a name="custom-copying-snapshot-sqlserver.XRCopy.STS"></a>

Session tokens from the global AWS Security Token Service (AWS STS) endpoint are valid only in AWS Regions that are enabled by default (commercial Regions). If you use credentials from the `assumeRole` API operation in AWS STS, use the regional endpoint if the source Region is an opt-in Region. Otherwise, the request fails. Your credentials must be valid in both Regions, which is true for opt-in Regions only when you use the regional AWS STS endpoint.

To use the global endpoint, make sure that it's enabled for both Regions in the operations. Set the global endpoint to `Valid` in all AWS Regions in the AWS STS account settings.

For more information, see [Managing AWS STS in an AWS Region](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) in the *AWS Identity and Access Management User Guide*.

## Snapshots of DB instances created with Custom Engine Versions (CEV)
<a name="custom-copying-snapshot-sqlserver.CEVSnap"></a>

For a DB snapshot of a DB instance using a [Custom Engine Version (CEV)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev-sqlserver.html), RDS associates the CEV with the DB snapshot. To copy a source DB snapshot associated with a CEV across AWS Regions, RDS copies the CEV along with the source DB snapshot to the destination region.

If you are copying multiple DB snapshots associated with the same CEV to the same destination region, the first copy request copies the associated CEV. The copy process of the following requests finds the initially copied CEV and associates it with the following DB snapshot copies. The existing CEV copy must be in `AVAILABLE` state to be associated with the DB snapshot copies.

To copy a DB snapshot associated with a CEV, the requester's IAM policy must have the permissions to authorize both the DB snapshot copying and the associated CEV copying. The following permissions are needed in your requester's IAM policy to allow the associated CEV copying:
+ `rds:CopyCustomDBEngineVersion` ‐ Your requester IAM principal needs to have the permission to copy the source CEV to the target region along with the source DB snapshot. The snapshot copy request fails due to authorization errors if your requester IAM principal is not authorized to copy the source CEV.
+ `ec2:CreateTags` ‐ The underlying EC2 AMI of the source CEV is copied to the target region as a part of the CEV copy. RDS Custom attempts to tag the AMI with the `AWSRDSCustom` tag before copying the AMI. Make sure your requester IAM principal has the permission to create the tag against the AMI underlying the source CEV in the source region.

For more information about CEV copying permissions, see [Grant required permissions to your IAM principal](#custom-copying-snapshot-sqlserver.GrantPermIAM).

## Grant required permissions to your IAM principal
<a name="custom-copying-snapshot-sqlserver.GrantPermIAM"></a>

Make sure that you have sufficient access to copy a RDS Custom for SQL Server DB snapshot. The IAM role or user (referred to as the IAM principal) for copying a DB snapshot using the console or CLI must have either of the following policies for successful DB instance creation:
+ The `AdministratorAccess` policy or,
+ The `AmazonRDSFullAccess` policy with the following additional permissions:

  ```
  s3:CreateBucket
  s3:GetBucketPolicy
  s3:PutBucketPolicy
  kms:CreateGrant
  kms:DescribeKey
  ec2:CreateTags
  ```

RDS Custom uses these permissions during snapshot copying across AWS Regions. These permissions configure resources in your account that are required for RDS Custom operations. For more information about the `kms:CreateGrant` permission, see [AWS KMS key management](Overview.Encryption.Keys.md). 

The following sample JSON policy grants the required permissions in addition to `AmazonRDSFullAccess` policy.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "CreateS3BucketAndReadWriteBucketPolicy",
            "Effect": "Allow",
            "Action": [
                "s3:CreateBucket",
                "s3:PutBucketPolicy",
                "s3:GetBucketPolicy"
            ],
            "Resource": "arn:aws:s3:::do-not-delete-rds-custom-*"
        },
        {
            "Sid": "CreateKmsGrant",
            "Effect": "Allow",
            "Action": [
                "kms:CreateGrant",
                "kms:DescribeKey"
            ],
            "Resource": "*"
        },
        {
            "Sid": "CreateEc2Tags",
            "Effect": "Allow",
            "Action": [
                "ec2:CreateTags"
            ],
            "Resource": "*"
        }
    ]
}
```

------

**Note**  
Make sure that the listed permissions aren't restricted by service control policies (SCPs), permission boundaries, or session policies associated with the IAM principal.

If you use conditions with context keys in the requester's IAM policy, certain conditions can cause the request to fail. For more information about common pitfalls due to IAM policy conditions, see [Requesting a cross-Region DB snapshot copy](USER_CopySnapshot.md#USER_CopySnapshot.AcrossRegions.Policy).

## Copying a DB snapshot
<a name="custom-copying-snapshot-sqlserver.CopyingDBSnapshot"></a>

Use the following procedures to copy a DB snapshot. For each AWS account, you can copy up to 20 DB snapshots at a time from one AWS Region to another. If you copy a DB snapshot to another AWS Region, you create a manual DB snapshot that is retained in that AWS Region. Copying a DB snapshot out of the source AWS Region incurs Amazon RDS data transfer charges. For more information about data transfer pricing, see [Amazon RDS pricing](https://aws.amazon.com/rds/pricing/).

After the DB snapshot copy has been created in the new AWS Region, the DB snapshot copy behaves the same as all other DB snapshots in that AWS Region.

You can copy a DB snapshot using the AWS Management Console, AWS CLI, or the Amazon RDS API.

------
#### [ Console ]

The following procedure copies a RDS Custom for SQL Server DB snapshot by using the AWS Management Console. 

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Snapshots**.

1. Select the RDS Custom for SQL Server DB snapshot that you want to copy.

1. In the **Actions** dropwdown , choose **Copy snapshot**.  
![\[The Copy snapshot page in the Amazon RDS console. The settings are loaded in the page.\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/images/XRSC-Snapshot-Copy.png)

1. To copy the DB snapshot to a different AWS Region, set **Destination Region** to the required value.
**Note**  
The destination AWS Region must have the same database engine version available as the source AWS Region.

1. For **New DB snapshot identifier**, enter a unique name for the DB snapshot. You can make multiple copies of an automated backup or manual snapshot but each copy must have a unique identifier.

1. (Optional) Select **Copy Tags** to copy tags and values from the snapshot to the copy of the snapshot.

1. For **Encryption**, specify the KMS key identifier to use to encrypt the DB snapshot copy.
**Note**  
RDS Custom for SQL Server encrypts all DB snapshots. You can't create an unencrypted DB snapshot.

1. Choose **Copy snapshot**.

RDS Custom for SQL Server creates a DB snapshot copy of your DB instance in the AWS Region of your selection.

------
#### [ AWS CLI ]

You can copy a RDS Custom for SQL Server DB snapshot by using the AWS CLI command [https://docs.aws.amazon.com/cli/latest/reference/rds/copy-db-snapshot.html](https://docs.aws.amazon.com/cli/latest/reference/rds/copy-db-snapshot.html). If you are copying the snapshot to a new AWS Region, run the command in the new AWS Region. The following options are used to copy a DB snapshot. Not all options are required for all scenarios. 
+ `--source-db-snapshot-identifier` ‐ The identifier for the source DB snapshot.
  + If the source snapshot is in a different AWS Region than the copy, specify a valid DB snapshot ARN. For example, `arn:aws:rds:us-west-2:123456789012:snapshot:instance1-snapshot-12345678`. 
+ `--target-db-snapshot-identifier` ‐ The identifier for the new copy of the DB snapshot.
+ `--kms-key-id` ‐The KMS key identifier for an encrypted DB snapshot. The KMS key identifier is the Amazon Resource Name (ARN), key identifier, or key alias for the KMS key.
  + If you copy an encrypted snapshot to a different AWS Region, then you must specify a KMS key for the destination AWS Region. KMS keys are specific to the AWS Region that they are created in and you cannot use encryption keys from one AWS Region in another AWS Region unless a multi-Region key is used. For more information on multi-Region KMS keys, see [Using multi-Region keys in AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html).
+ `--copy-tags` ‐ Include the tags and values from the source snapshot to the copy of the snapshot.

The following options are not supported for copying an RDS Custom for SQL Server DB snapshot:
+ `--copy-option-group `
+ `--option-group-name`
+ `--pre-signed-url`
+ `--target-custom-availability-zone`

The following code example copies an encrypted DB snapshot from the US West (Oregon) Region to the US East (N. Virginia) Region. Run the command in the destination (us-east-1) Region.

For Linux, macOS, or Unix:

```
aws rds copy-db-snapshot \
     --region us-east-1 \
    --source-db-snapshot-identifier arn:aws:rds:us-west-2:123456789012:snapshot:instance1-snapshot-12345678 \
    --target-db-snapshot-identifier mydbsnapshotcopy \
    --kms-key-id a1b2c3d4-1234-5678-wxyz-a1b2c3d4d5e6
```

For Windows:

```
aws rds copy-db-snapshot ^
     --region us-east-1 ^
    --source-db-snapshot-identifier arn:aws:rds:us-west-2:123456789012:snapshot:instance1-snapshot-12345678 ^
    --target-db-snapshot-identifier mydbsnapshotcopy ^
    --kms-key-id a1b2c3d4-1234-5678-wxyz-a1b2c3d4d5e6
```

------
#### [ RDS API ]

You can copy a RDS Custom for SQL Server DB snapshot by using the Amazon RDS API operation [CopyDBSnapshot](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CopyDBSnapshot.html). If you are copying the snapshot to a new AWS Region, perform the action in the new AWS Region. The following parameters are used to copy a DB snapshot. Not all parameters are required: 
+ `SourceDBSnapshotIdentifier` ‐ The identifier for the source DB snapshot.
  + If the source snapshot is in a different AWS Region than the copy, specify a valid DB snapshot ARN. For example, `arn:aws:rds:us-west-2:123456789012:snapshot:instance1-snapshot-12345678`.
+ `TargetDBSnapshotIdentifier` ‐ The identifier for the new copy of the DB snapshot.
+ `KmsKeyId` ‐ The KMS key identifier for an encrypted DB snapshot. The KMS key identifier is the Amazon Resource Name (ARN), key identifier, or key alias for the KMS key.
  + If you copy an encrypted snapshot to a different AWS Region, then you must specify a KMS key for the destination AWS Region. KMS keys are specific to the AWS Region that they are created in and you cannot use encryption keys from one AWS Region in another AWS Region unless a multi-Region key is used. For more information on multi-Region KMS keys, see [Using multi-Region keys in AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html).
+ `CopyTags` ‐ Set this parameter to `true` to copy tags and values from the source snapshot to the copy of the snapshot. The default is `false`.

The following options are not supported copying a RDS Custom for SQL Server DB snapshot:
+ `CopyOptionGroup`
+ `OptionGroupName`
+ `PreSignedUrl`
+ `TargetCustomAvailabilityZone`

The following code creates a copy of a snapshot, with the new name `mydbsnapshotcopy`, in the US East (N. Virginia) Region.

```
https://rds.us-east-1.amazonaws.com/
    ?Action=CopyDBSnapshot
    &KmsKeyId=a1b2c3d4-1234-5678-wxyz-a1b2c3d4d5e6
    &SourceDBSnapshotIdentifier=arn%3Aaws%3Ards%3Aus-west-2%3A123456789012%3Asnapshot%3Ainstance1-snapshot-12345678
    &TargetDBSnapshotIdentifier=mydbsnapshotcopy
    &Version=2014-10-31
    &X-Amz-Algorithm=AWS4-HMAC-SHA256
    &X-Amz-Credential=AKIADQKE4SARGYLE/20161117/us-east-1/rds/aws4_request
    &X-Amz-Date=20161117T221704Z
    &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date
    &X-Amz-Signature=da4f2da66739d2e722c85fcfd225dc27bba7e2b8dbea8d8612434378e52adccf
```

------

# Migrating an on-premises database to Amazon RDS Custom for SQL Server
<a name="custom-migrating"></a>

You can use the following process to migrate an on-premises Microsoft SQL Server database to Amazon RDS Custom for SQL Server using native backup and restore:

1. Take a full backup of the database on the on-premises DB instance.

1. Upload the backup file to Amazon S3.

1. Download the backup file from S3 to your RDS Custom for SQL Server DB instance.

1. Restore a database using the downloaded backup file on the RDS Custom for SQL Server DB instance.

This process explains the migration of a database from on-premises to RDS Custom for SQL Server, using native full backup and restore. To reduce the cutover time during the migration process, you might also consider using differential or log backups.

For general information about native backup and restore for RDS for SQL Server, see [Importing and exporting SQL Server databases using native backup and restore](SQLServer.Procedural.Importing.md).

**Topics**
+ [

## Prerequisites
](#custom-migrating.prereqs)
+ [

## Backing up the on-premises database
](#custom-migrating.backup)
+ [

## Uploading the backup file to Amazon S3
](#custom-migrating.upload)
+ [

## Downloading the backup file from Amazon S3
](#custom-migrating.upload)
+ [

## Restoring the backup file to the RDS Custom for SQL Server DB instance
](#custom-migrating.restore)

## Prerequisites
<a name="custom-migrating.prereqs"></a>

Perform the following tasks before migrating the database:

1. Configure Remote Desktop Connection (RDP) for your RDS Custom for SQL Server DB instance. For more information, see [Connecting to your RDS Custom DB instance using RDP](custom-creating-sqlserver.rdp.md).

1. Configure access to Amazon S3 so you can upload and download the database backup file.

## Backing up the on-premises database
<a name="custom-migrating.backup"></a>

You use SQL Server native backup to take a full backup of the database on the on-premises DB instance.

The following example shows a backup of a database called `mydatabase`, with the `COMPRESSION` option specified to reduce the backup file size.

**To back up the on-premises database**

1. Using SQL Server Management Studio (SSMS), connect to the on-premises SQL Server instance.

1. Run the following T-SQL command.

   ```
   backup database mydatabase to
   disk ='C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\mydb-full-compressed.bak'
   with compression;
   ```

## Uploading the backup file to Amazon S3
<a name="custom-migrating.upload"></a>

You use the AWS Management Console to upload the backup file `mydb-full-compressed.bak` to Amazon S3.

**To upload the backup file to S3**

1. Sign in to the AWS Management Console and open the Amazon S3 console at [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/).

1. For **Buckets**, choose the name of the bucket to which you want to upload your backup file.

1. Choose **Upload**.

1. In the **Upload** window, do one of the following:
   + Drag and drop `mydb-full-compressed.bak` to the **Upload** window.
   + Choose **Add file**, choose `mydb-full-compressed.bak`, and then choose **Open**.

   Amazon S3 uploads your backup file as an S3 object. When the upload completes, you can see a success message on the **Upload: status** page.

## Downloading the backup file from Amazon S3
<a name="custom-migrating.upload"></a>

You use the console to download the backup file from S3 to the RDS Custom for SQL Server DB instance.

**To download the backup file from S3**

1. Using RDP, connect to your RDS Custom for SQL Server DB instance.

1. Sign in to the AWS Management Console and open the Amazon S3 console at [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/).

1. In the **Buckets** list, choose the name of the bucket that contains your backup file.

1. Choose the backup file `mydb-full-compressed.bak`.

1. For **Actions**, choose **Download as**.

1. Open the context (right-click) menu for the link provided, then choose **Save As**.

1. Save `mydb-full-compressed.bak` to the `D:\rdsdbdata\BACKUP` directory.

## Restoring the backup file to the RDS Custom for SQL Server DB instance
<a name="custom-migrating.restore"></a>

You use SQL Server native restore to restore the backup file to your RDS Custom for SQL Server DB instance.

In this example, the `MOVE` option is specified because the data and log file directories are different from the on-premises DB instance.

**To restore the backup file**

1. Using SSMS, connect to your RDS Custom for SQL Server DB instance.

1. Run the following T-SQL command.

   ```
   restore database mydatabase from disk='D:\rdsdbdata\BACKUP\mydb-full-compressed.bak'
   with move 'mydatabase' to 'D:\rdsdbdata\DATA\mydatabase.mdf',
   move 'mydatabase_log' to 'D:\rdsdbdata\DATA\mydatabase_log.ldf';
   ```

# RDS Custom for SQL Server Operating system updates
<a name="custom-os-upgrade"></a>

RDS Custom for SQL Server provides the following methods to apply operating system updates to your RDS Provided Engine Version (RPEV) instances:
+ *system-update maintenance actions*
+ *database minor version upgrades*
  + DB minor engine version upgrades using RPEV include up to date Operating System updates. This approach is particularly useful if you want to combine OS updates with SQL Server minor version upgrades. For more information, see [Upgrading an Amazon RDS Custom for SQL Server DB instance](custom-upgrading-sqlserver.md).

## Scenarios for Operating system update
<a name="custom-os-upgrade.Scenarios"></a>

There are two ways to ways to manage Operating system updates for your RDS Custom for SQL Server instances:
+ For Single-AZ instances, the instance is unavailable during the Operating system update.
+ For Multi-AZ deployments, RDS applies operating system updates in the following manner:
  + First, RDS performs an Operating system update on the standby instance.
  + RDS fails over to the upgraded standby DB instance, making it the new primary DB instance.
  + Lastly, RDS performs an Operating system update on the new standby DB instance.

The downtime for Multi-AZ deployments is the time it takes for the failover. 

## Applying Operating system updates using system-update maintenance actions
<a name="custom-os-upgrade.SystemUpdates"></a>

To apply Operating system updates to your Amazon RDS RPEV instances, you can use the AWS Management Console, AWS CLI, or RDS API. For more information, see [Operating system updates for RDS DB instances](USER_UpgradeDBInstance.Maintenance.md#OS_Updates).

**Example**  
For Linux, macOS, or Unix:  
**Step 1: Check for available updates**  
Use the `describe-pending-maintenance-actions` command to see if OS updates are available for your instances:  

```
aws rds describe-pending-maintenance-actions
```
Example response:  

```
{
    "PendingMaintenanceActions": [
        {
            "ResourceIdentifier": "arn:aws:rds:us-east-1:111122223333:db:my-sqlserver-instance",
            "PendingMaintenanceActionDetails": [
                {
                    "Action": "system-update",
                    "Description": "New Operating System update is available"
                }
            ]
        }
    ]
}
```
An action type of `system-update` indicates that an OS update is available for your instance.  
**Step 2: Apply the OS update**  
Use the `apply-pending-maintenance-action` command to schedule the update:  

```
aws rds apply-pending-maintenance-action \ 
                --resource-identifier arn:aws:rds:us-east-1:111122223333:db:my-sqlserver-instance \ 
                --apply-action system-update \ 
                --opt-in-type immediate
```
The `opt-in-type` input has the following options:  
+ `immediate`: Apply the update right away
+ `next-maintenance`: Apply the update during the next scheduled maintenance window
+ `undo-opt-in`: Cancel a previously scheduled update
Example response:  

```
{
    "ResourcePendingMaintenanceActions": {
        "ResourceIdentifier": "arn:aws:rds:us-east-1:111122223333:db:my-sqlserver-instance",
        "PendingMaintenanceActionDetails": [
            {
                "Action": "system-update",
                "AutoAppliedAfterDate": "2024-04-10T20:41:01.695000+00:00",
                "ForcedApplyDate": "2024-04-10T20:41:01.694000+00:00",
                "CurrentApplyDate": "2024-04-10T20:41:01.695000+00:00",
                "Description": "New Operating System update is available"
            }
        ]
    }
}
```

## OS update notifications
<a name="custom-os-upgrade.OSNotifications"></a>

To be notified when a new, optional operating system patch becomes available, you can subscribe to [RDS-EVENT-0230](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html#RDS-EVENT-0230) in the security patching event category. For information about subscribing to RDS events, see [Subscribing to Amazon RDS event notification](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Subscribing.html).

## Considerations
<a name="custom-os-upgrade.Considerations"></a>

The following consideations and limitations apply to OS updates:
+ Any operating system customizations made to the C:\$1 drive are not preserved during Operating system updates. 
+ We recommend taking a manual snapshot before applying updates.

# Upgrading an Amazon RDS Custom for SQL Server DB instance
<a name="custom-upgrading-sqlserver"></a>

You can upgrade an Amazon RDS Custom for SQL Server DB instance by modifying it to use a new DB engine version. For general information about upgrading DB instances, see [Upgrading a DB instance engine version](USER_UpgradeDBInstance.Upgrading.md).

**Topics**
+ [

## Overview of upgrades in RDS Custom for SQL Server
](#custom-upgrading-sqlserver.Overview)
+ [

## Upgrading major and minor engine version
](#custom-upgrading-sqlserver.Upgrade)
+ [

## Database compatibility level
](#custom-upgrading-sqlserver.Major.Compatibility)

## Overview of upgrades in RDS Custom for SQL Server
<a name="custom-upgrading-sqlserver.Overview"></a>

Amazon RDS Custom for SQL Server supports major and minor version upgrades. Minor version upgrades can include security patches, bug fixes, and engine improvements. Microsoft releases these updates as cumulative updates (CUs). Major version upgrades introduce new features and engine changes between versions, like upgrading from SQL Server 2019 to 2022. You can apply both upgrades immediately or during scheduled maintenance windows. To prevent potential backward compatibility issues, we recommend testing your applications in a non-production environment before upgrading. 

RDS Custom for SQL Server allows you to upgrade an RDS Provided Engine Version (RPEV) or a Custom Engine Version (CEV).
+ RDS-provided engine versions (RPEV) contain up-to-date operating system (OS) patches and SQL Server cumulative updates (CU).
+ For a custom engine version (CEV), you must follow a two-step process. First, create a new CEV with your target SQL Server version, see [Preparing to create a CEV for RDS Custom for SQL Server](custom-cev-sqlserver.preparing.md). This target version must be equal to or newer than your current version. Once the new CEV is created, modify your database instance to use this new version. For more information, see [ Performing a minor version upgrade for Amazon RDS Custom for SQL Server CEV with Multi-AZ](https://aws.amazon.com/blogs/database/performing-a-minor-version-upgrade-for-amazon-rds-custom-for-sql-server-cev-with-multi-az/).

  Do not apply SQL Server cumulative updates in-place to your running RDS Custom instance. Once you create a CEV with a specific SQL Server version (for example, SQL Server 2022 CU16), applying a newer cumulative update directly to the instance takes it out of the support perimeter and reports error `SP-S3006`. To patch an existing SQL Server instance using a CEV, create a new CEV that includes the desired cumulative update, then modify your existing instance to switch to the new CEV.

If you upgrade an RDS Custom for SQL Server DB instance in a Multi-AZ deployment, RDS Custom for SQL Server performs rolling upgrades for your instance. This approach minimizes downtime by upgrading one instance at a time. RDS performs the following actions to perform rolling upgrades:

1. Upgrade the standby DB instance.

1. Failover to the upgraded standby DB instance, making it the new primary DB instance.

1. Upgrade the new standby DB instance.

The DB instance downtime for Multi-AZ deployments is the time it takes for the failover.

The following limitations apply when upgrading an RDS Custom for SQL Server DB instance:
+ Custom DB option and parameter groups aren't supported.
+ Any additional storage volumes that you attach to your RDS Custom for SQL Server DB instance are not attached after the upgrade.
+ For CEVs, in-place application of SQL Server cumulative updates is not supported and results in the instance being taken out of the support perimeter.

## Upgrading major and minor engine version
<a name="custom-upgrading-sqlserver.Upgrade"></a>

Both major and minor engine version upgrades are irreversible and must always be done to a newer version. To identify available target versions, use the AWS Management Console and choose from the available versions when modifying your DB instance. Alternatively, use the [https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-engine-versions.html](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-engine-versions.html) CLI command or [DescribeDBEngineVersions](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBEngineVersions.html) RDS API command.

For Linux, macOS, or Unix:

```
aws rds describe-db-engine-versions \
    --engine custom-sqlserver-se \
    --engine-version 15.00.4322.2.v1 \
    --query "DBEngineVersions[*].ValidUpgradeTarget[*].{EngineVersion:EngineVersion}" \
    --output table
```

For Windows:

```
aws rds describe-db-engine-versions ^
    --engine custom-sqlserver-se ^
    --engine-version 15.00.4322.2.v1 ^
    --query "DBEngineVersions[*].ValidUpgradeTarget[*].{EngineVersion:EngineVersion}" ^
    --output table
```

The output shows the available target engine versions:

```
--------------------------
|DescribeDBEngineVersions|
+------------------------+
|      EngineVersion     |
+------------------------+
|  15.00.4410.1.v1       |
|  15.00.4415.2.v1       |
|  15.00.4430.1.v1       |
|  16.00.4165.4.v1       |
|  16.00.4175.1.v1       |
|  16.00.4185.3.v1       |
+------------------------+
```

After identifying your target version, use the AWS Management Console and follow the instructions in [Modifying an RDS Custom for SQL Server DB instance](custom-managing.modify-sqlserver.md). Alternatively, use [https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) CLI command or [ModifyDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html) RDS API command.

For Linux, macOS, or Unix:

```
aws rds modify-db-instance \
    --db-instance-identifier DB_INSTANCE_IDENTIFIER \
    --engine-version ENGINE_VERSION \
    --allow-major-version-upgrade \
    --region Region \
    --no-apply-immediately
```

For Windows:

```
aws rds modify-db-instance ^
    --db-instance-identifier DB_INSTANCE_IDENTIFIER ^
    --engine-version ENGINE_VERSION ^
    --allow-major-version-upgrade ^
    --region Region ^
    --no-apply-immediately
```

**Note**  
You must include the `--allow-major-version-upgrade` parameter to perform major version upgrades.

## Database compatibility level
<a name="custom-upgrading-sqlserver.Major.Compatibility"></a>

You can use Microsoft SQL Server database compatibility levels to adjust some database behaviors to mimic previous versions of SQL Server. For more information, see [Compatibility level](https://msdn.microsoft.com/en-us/library/bb510680.aspx) in the Microsoft documentation. 

When you upgrade your DB instance, all existing databases remain at their original compatibility level. For example, if you upgrade from SQL Server 2019 to SQL Server 2022, all existing databases have a compatibility level of 150. Any new database created after the upgrade have compatibility level 160. 

You can change the compatibility level of a database by using the ALTER DATABASE command. For example, to change a database named `customeracct` to be compatible with SQL Server 2022, issue the following command: 

```
1. ALTER DATABASE customeracct SET COMPATIBILITY_LEVEL = 160
```

# Troubleshooting DB issues for Amazon RDS Custom for SQL Server
<a name="custom-troubleshooting-sqlserver"></a>

The shared responsibility model of RDS Custom provides OS shell–level access and database administrator access. RDS Custom runs resources in your account, unlike Amazon RDS, which runs resources in a system account. With greater access comes greater responsibility. In the following sections, you can learn how to troubleshoot issues with Amazon RDS Custom for SQL Server DB instances.

**Note**  
This section explains how to troubleshoot RDS Custom for SQL Server. For troubleshooting RDS Custom for Oracle, see [Troubleshooting DB issues for Amazon RDS Custom for Oracle](custom-troubleshooting.md).

**Topics**
+ [

## Viewing RDS Custom events
](#custom-troubleshooting-sqlserver.support-perimeter.viewing-events)
+ [

## Subscribing to RDS Custom events
](#custom-troubleshooting-sqlserver.support-perimeter.subscribing)
+ [

## Troubleshooting CEV errors for RDS Custom for SQL Server
](#custom-troubleshooting-sqlserver.cev)
+ [

## Fixing unsupported configurations in RDS Custom for SQL Server
](#custom-troubleshooting-sqlserver.fix-unsupported)
+ [

## Troubleshooting `Storage-Full` in RDS Custom for SQL Server
](#custom-troubleshooting-storage-full)
+ [

## Troubleshooting PENDING\$1RECOVERY state for TDE enabled databases in RDS Custom for SQL Server
](#custom-troubleshooting-sqlserver.pending_recovery)

## Viewing RDS Custom events
<a name="custom-troubleshooting-sqlserver.support-perimeter.viewing-events"></a>

The procedure for viewing events is the same for RDS Custom and Amazon RDS DB instances. For more information, see [Viewing Amazon RDS events](USER_ListEvents.md).

To view RDS Custom event notification using the AWS CLI, use the `describe-events` command. RDS Custom introduces several new events. The event categories are the same as for Amazon RDS. For the list of events, see [Amazon RDS event categories and event messages](USER_Events.Messages.md).

The following example retrieves details for the events that have occurred for the specified RDS Custom DB instance.

```
1. aws rds describe-events \
2.     --source-identifier my-custom-instance \
3.     --source-type db-instance
```

## Subscribing to RDS Custom events
<a name="custom-troubleshooting-sqlserver.support-perimeter.subscribing"></a>

The procedure for subscribing to events is the same for RDS Custom and Amazon RDS DB instances. For more information, see [Subscribing to Amazon RDS event notification](USER_Events.Subscribing.md).

To subscribe to RDS Custom event notification using the CLI, use the `create-event-subscription` command. Include the following required parameters:
+ `--subscription-name`
+ `--sns-topic-arn`

The following example creates a subscription for backup and recovery events for an RDS Custom DB instance in the current AWS account. Notifications are sent to an Amazon Simple Notification Service (Amazon SNS) topic, specified by `--sns-topic-arn`.

```
1. aws rds create-event-subscription \
2.     --subscription-name my-instance-events \
3.     --source-type db-instance \
4.     --event-categories '["backup","recovery"]' \
5.     --sns-topic-arn arn:aws:sns:us-east-1:123456789012:interesting-events
```

## Troubleshooting CEV errors for RDS Custom for SQL Server
<a name="custom-troubleshooting-sqlserver.cev"></a>

When you try to create a CEV, it might fail. In this case, RDS Custom issues the `RDS-EVENT-0198` event message. For more information on viewing RDS events, see [Amazon RDS event categories and event messages](USER_Events.Messages.md). 

Use the following information to help you address possible causes.


****  

| Message | Troubleshooting suggestions | 
| --- | --- | 
| `Custom Engine Version creation expected a Sysprep’d AMI. Retry creation using a Sysprep’d AMI.` | Run Sysprep on the EC2 instance that you created from the AMI. For more information about prepping an AMI using Sysprep, see [Create a standardized Amazon Machine Image (AMI) using Sysprep](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_EBSbacked_WinAMI.html#sysprep-using-ec2launchv2). | 
| `EC2 Image permissions for image (AMI_ID) weren't found for customer (Customer_ID). Verify customer (Customer_ID) has valid permissions on the EC2 Image.` | Verify that your account and profile used for creation has the required permissions on `create EC2 Instance` and `Describe Images` for the selected AMI. | 
| `Failed to rebuild databases with server collation (collation name) due to missing setup.exe file for SQL Server.` | Verify that the `setup` file is available at `C:\Program Files\Microsoft SQL Server\nnn\Setup Bootstrap\SQLnnnn\setup.exe`. | 
| `Image (AMI_ID) doesn't exist in your account (ACCOUNT_ID). Verify (ACCOUNT_ID) is the owner of the EC2 image.` | Ensure the AMI exists in the same customer account. | 
| `Image id (AMI_ID) isn't valid. Specify a valid image id, and try again.` | The name of the AMI is incorrect. Ensure the correct AMI ID is provided. | 
| `Image (AMI_ID) operating system platform isn't supported. Specify a valid image, and try again.` |  Choose a supported AMI that has Windows Server with SQL Server Enterprise, Standard, or Web edition. Choose an AMI with one of the following usage operation codes from the EC2 Marketplace: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-troubleshooting-sqlserver.html)  | 
| `SQL Server Web Edition isn't supported for creating a Custom Engine Version using Bring Your Own Media. Specify a valid image, and try again.` | Use an AMI that contains a supported edition of SQL Server. For more information, see [Version support for RDS Custom for SQL Server CEVs](custom-cev-sqlserver.preparing.md#custom-cev-sqlserver.preparing.VersionSupport). | 
| `The custom engine version can't be the same as the OEV engine version. Specify a valid CEV, and try again.` | Classic RDS Custom for SQL Server engine versions aren't supported. For example, version **15.00.4073.23.v1**. Use a supported version number. | 
| `The custom engine version isn't in an active state. Specify a valid CEV, and try again.` | The CEV must be in an `AVAILABLE` state to complete the operation. Modify the CEV from `INACTIVE` to `AVAILABLE`.  | 
| `The custom engine version isn't valid for an upgrade. Specify a valid CEV with an engine version greater or equal to (X), and try again.` | The target CEV is not valid. Check the requirements for a valid upgrade path.  | 
| `The custom engine version isn't valid. Names can include only lowercase letters (a-z), dashes (-), underscores (_), and periods (.). Specify a valid CEV, and try again.` | Follow the required CEV naming convention. For more information, see [Requirements for RDS Custom for SQL Server CEVs](custom-cev-sqlserver.preparing.md#custom-cev-sqlserver.preparing.Requirements). | 
| `The custom engine version isn't valid. Specify valid database engine version, and try again. Example: 15.00.4073.23-cev123.` | An unsupported DB engine version was provided. Use a supported DB engine version. | 
| `The expected architecture is (X) for image (AMI_ID), but architecture (Y) was found.` | Use an AMI built on the **x86\$164** architecture. | 
| `The expected owner of image (AMI_ID) is customer account ID (ACCOUNT_ID), but owner (ACCOUNT_ID) was found.` | Create the EC2 instance from the AMI that you have permission for. Run Sysprep on the EC2 instance to create and save a base image.  | 
| `The expected platform is (X) for image (AMI_ID), but platform (Y) was found.` | Use an AMI built with the Windows platform. | 
| `The expected root device type is (X) for image %s, but root device type (Y) was found.` | Create the AMI with the EBS device type. | 
| `The expected SQL Server edition is (X), but (Y) was found.` |  Choose a supported AMI that has Windows Server with SQL Server Enterprise, Standard, or Web edition. Choose an AMI with one of the following usage operation codes from the EC2 Marketplace: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-troubleshooting-sqlserver.html)  | 
| `The expected state is (X) for image (AMI_ID), but the following state was found: (Y).` | Ensure the AMI is in a state of `AVAILABLE`. | 
| `The provided Windows OS name (X) isn’t valid. Make sure the OS is one of the following: (Y).` | Use a supported Windows OS. | 
| `Unable to find bootstrap log file in path.` | Verify that the log file is available at `C:\Program Files\Microsoft SQL Server\nnn\Setup Bootstrap\Log\Summary.txt`. | 
| `RDS expected a Windows build version greater than or equal to (X), but found version (Y).`. | Use an AMI with a minimum OS build version of **14393**.  | 
| `RDS expected a Windows major version greater than or equal to (X), but found version (Y).`. | Use an AMI with a minimum OS major version of **10.0** or higher.  | 

## Fixing unsupported configurations in RDS Custom for SQL Server
<a name="custom-troubleshooting-sqlserver.fix-unsupported"></a>

Because of the shared responsibility model, it's your responsibility to fix configuration issues that put your RDS Custom for SQL Server DB instance into the `unsupported-configuration` state. If the issue is with the AWS infrastructure, you can use the console or the AWS CLI to fix it. If the issue is with the operating system or the database configuration, you can log in to the host to fix it.

**Note**  
This section explains how to fix unsupported configurations in RDS Custom for SQL Server. For information about RDS Custom for Oracle, see [Fixing unsupported configurations in RDS Custom for Oracle](custom-troubleshooting.md#custom-troubleshooting.fix-unsupported).

In the following tables, you can find descriptions of the notifications and events that the support perimeter sends and how to fix them. These notifications and the support perimeter are subject to change. For background on the support perimeter, see [RDS Custom support perimeter](custom-concept.md#custom-troubleshooting.support-perimeter). For event descriptions, see [Amazon RDS event categories and event messages](USER_Events.Messages.md).


| Event Code | Configuration area | RDS event message | Validation process | 
| --- | --- | --- | --- | 
|  `SP-S0000`  |  Manual Unsupported Configuration  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: `X`.  |  To resolve this issue, create a support case.  | 

**AWS resource (infrastructure)**


| Event Code | Configuration area | RDS event message | Validation process | 
| --- | --- | --- | --- | 
|  `SP-S1001`  |  EC2 Instance State  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The underlying EC2 instance %s has been stopped without stopping the RDS instance. You can resolve this by starting the underlying EC2 instance and ensuring that the binary and data volumes are attached. If your intention is to stop the RDS instance, make sure that underlying EC2 instance is in the AVAILABLE state first and then use the RDS console or CLI to stop the RDS instance.  |  To check the status of a DB instance, use the console or run the following AWS CLI command: <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep DBInstanceStatus<br />                            </pre>  | 
|  `SP-S1002`  |  EC2 Instance State  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The RDS DB instance status is set to `STOPPED` but the underlying EC2 instance %s has been started. You can resolve this by stopping the underlying EC2 instance. If your intention is to start the RDS instance, use the console or CLI.  |   Use the following AWS CLI command to check the status of a DB instance: <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep DBInstanceStatus</pre> You can also check the status of the EC2 instance using the EC2 console. To start a DB instance, use the console or run the following AWS CLI command: <pre>aws rds start-db-instance \<br />    --db-instance-identifier db-instance-name</pre>  | 
|  `SP-S1003`   |  EC2 Instance Class  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: There is a mismatch between the expected and configured DB instance class of the EC2 host. You can resolve this by modifying the DB instance class to its original class type.  |   Use the following CLI command to check the expected DB instance class:  <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep DBInstanceClass</pre>  | 
|  `SP-S1004`  |  EBS Storage Volume Not Accessible  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The original EBS storage volume %s that was associated with the EC2 instance is currently not accessible.   |    | 
|  `SP-S1005`  |  EBS Storage Volume Detached  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The original EBS storage volume "volume-id" isn’t attached. You can resolve this by attaching the EBS volume associated to the EC2 instance.   |   After re-attaching the EBS volume, use the following CLI commands to check if the EBS volume 'volume-id' is properly attached to the RDS instance:  <pre>aws ec2 describe-volumes \<br />    --volume-ids volume-id |grep InstanceId</pre>  | 
|  `SP-S1006`  |  EBS Storage Volume Size  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: There is a mismatch between the expected and configured settings of EBS storage volume "volume-id". The volume size has been changed manually at EC2 level from its original value(s) of [%s]. To resolve this issue, create a support case.   |   Use the following CLI command to compare the volume size of the EBS volume 'volume-id' details and the RDS instance details:  <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep AllocatedStorage</pre>  Use the following CLI command to view the actual allocated volume size:  <pre>aws ec2 describe-volumes \<br />    --volume-ids |grep Size</pre>  | 
|  `SP-S1007`  |  EBS Storage Volume Configuration  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: There is a mismatch between the expected and configured settings of EBS storage volume "volume-id". You can resolve this by modifying the EBS storage volume configuration [IOPS, Throughput, Volume type] to its original value(s) of [IOPS: %s, Throughput: %s, Volume type: %s] at the EC2 level. For future storage modifications, use the RDS console or CLI. The volume size has also been changed manually at EC2 level from its original value(s) of [%s]. To resolve this issue, create a support case.   |   Use the following CLI command to compare the volume type of the EBS volume 'volume-id' details and the RDS instance details. Make sure that the values at the EBS level matches the values at the RDS level:  <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep StorageType</pre> To get the expected value for Storage Throughput at the RDS level: <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep StorageThroughput</pre>  To get the expected value for Volume IOPS at the RDS level: <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep Iops</pre> To get the current Storage Type at the EC2 Level: <pre>aws ec2 describe-volumes \<br />    --volume-ids |grep VolumeType</pre>  To get the current value for Storage Throughput at the EC2 Level: <pre>aws ec2 describe-volumes \<br />    --volume-ids |grep Throughput</pre> To get the current value for Volume IOPS at the EC2 Level: <pre>aws ec2 describe-volumes \<br />    --volume-ids |grep Iops</pre>  | 
|  `SP-S1008`  |  EBS Storage Volume Size and Configuration  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: There is a mismatch between the expected and configured settings of EBS storage volume "volume-id". You can resolve this by modifying the EBS storage volume configuration [IOPS, Throughput, Volume type] to its original value(s) of [IOPS: %s, Throughput: %s, Volume type: %s] at the EC2 level. For future storage modifications, use the RDS console or CLI. The volume size has also been changed manually at EC2 level from its original value(s) of [%s]. To resolve this issue, create a support case.   |   Use the following CLI command to compare the volume type of the EBS volume 'volume-id' details and the RDS instance details. Make sure that the values at the EBS level matches the values at the RDS level:  <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep StorageType</pre> To get the expected value for Storage Throughput at the RDS level: <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep StorageThroughput</pre>  To get the expected value for Volume IOPS at the RDS level: <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep Iops</pre> To get the current Storage Type at the EC2 Level: <pre>aws ec2 describe-volumes \<br />    --volume-ids |grep VolumeType</pre>  To get the current value for Storage Throughput at the EC2 Level: <pre>aws ec2 describe-volumes \<br />    --volume-ids |grep Throughput</pre> To get the current value for Volume IOPS at the EC2 Level: <pre>aws ec2 describe-volumes \<br />    --volume-ids |grep Iops</pre> To get the expected Allocated Volume Size: <pre>aws rds describe-db-instances \<br />    --db-instance-identifier db-instance-name |grep AllocatedStorage</pre> To get the actual Allocated Volume Size: <pre>aws ec2 describe-volumes \<br />    --volume-ids |grep Size</pre>  | 
|  `SP-S1009`  |  SQS Permissions  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: Amazon Simple Queue Service (SQS) permissions are missing for the IAM instance profile. You can resolve this by making sure the IAM profile associated with the host has the following permissions: ["SQS:SendMessage","SQS:ReceiveMessage","SQS:DeleteMessage","SQS:GetQueueUrl"].   |    | 
|  `SP-S1010`  |  SQS VPC Endpoint  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: A VPC endpoint policy is blocking the Amazon Simple Queue Service (SQS) operations. You can resolve this by modifying your VPC endpoint policy to allow the required SQS actions.   |    | 
|  `SP-S1011`  |  Event bus policy  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The resource-based policy for your event bus arn:aws:events:region-1:123456789012:event-bus/default denies Amazon CloudWatch events:PutEvents actions. Resolve this by modifying your resource-based policy to allow events:PutEvents actions for EventBus %s.  |    | 
|  `SP-S1012`  |  CloudWatch VPC permissions  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: A VPC endpoint policy is missing permissions to access Amazon CloudWatch events. Resolve this by modifying your VPC endpoint policy to allow events:PutEvents on EventBus arn:aws:events:region-1:123456789012:event-bus/default.  |    | 
|  `SP-S1013`  |  Service control policy  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: A service control policy in your AWS Organizations is missing permissions to access Amazon CloudWatch events. Resolve this by modifying your service control policy to allow events:PutEvents on EventBus arn:aws:events:region-1:123456789012:event-bus/default.  |    | 
|  `SP-S1014`  |  IAM instance profile  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: Your IAM instance profile %s permissions deny Amazon CloudWatch events. Resolve this by setting ["events:PutEvents"] to 'Allow' and allowing events:PutEvents on EventBus arn:aws:events:region-1:123456789012:event-bus/default in your IAM profile associated with the instance.  |    | 
|  `SP-S1015`  |  IAM instance profile  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: Your IAM instance profile %s is missing Amazon CloudWatch event permissions. Resolve this by including the ["events:PutEvents"] permissions and allowing events:PutEvents on EventBus arn:aws:events:region-1:123456789012:event-bus/default in your IAM profile associated with the instance.  |    | 
|  `SP-S1016`  |  IAM permissions boundary  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: Your IAM instance profile %s has permissions boundary that deny Amazon CloudWatch events. Resolve this by setting ["events:PutEvents"] to 'Allow' for the EventBus arn:aws:events:region-1:123456789012:event-bus/default in your IAM instance profile permissions boundary.  |    | 

**Operating system**


| Event Code | Configuration area | RDS event message | Validation process | 
| --- | --- | --- | --- | 
|  `SP-S2001`  |  SQL Service Status  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The SQL Server service isn’t started. You can resolve this by restarting the SQL Server service on the host. If this DB instance is a Multi-AZ DB instance and restart fails, then stop and start the host to initiate a failover.   |  | 
|  `SP-S2002`  |  RDS Custom Agent Status  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The RDS Custom Agent service isn’t installed or couldn’t be started. You can resolve this by reviewing the Windows Event Log to determine why the service won’t start, and take appropriate steps to fix the issue. For additional assistance, create a support case.   |  Log in to the host and make sure that the RDS Custom agent is running. You can use the following commands to view the agent status. <pre>$name = "RDSCustomAgent"<br />$service = Get-Service $name<br />Write-Host $service.Status</pre> If the status isn't `Running`, you can start the service with the following command: <pre>Start-Service $name</pre> If the agent can't start, check the Windows Events to see why it can't start. The agent requires a Windows user to start the service. Ensure a Windows user exists and has privileges to run the service.  | 
|  `SP-S2003`  |  SSM Agent Status  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The Amazon SSM Agent service is unreachable. You can troubleshoot this by checking the service status with the `Get-Service AmazonSSMAgent` PowerShell command, or starting the service with `Start-Service AmazonSSMAgent`. Ensure that HTTPS (port 443) outbound traffic to the **ssm**, **ssmmessages**, and **ec2messages** regional endpoints is allowed.   |  For more information, see [Troubleshooting SSM Agent](https://docs.aws.amazon.com/systems-manager/latest/userguide/troubleshooting-ssm-agent.html). To troubleshoot SSM endpoints, see [Unable to connect to SSM endpoints](https://docs.aws.amazon.com/systems-manager/latest/userguide/troubleshooting-ssm-agent.html#systems-manager-ssm-agent-troubleshooting-endpoint-access) and [Use ssm-cli to troubleshoot managed node availability](https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-cli.html#agent-ts-ssm-cli).  | 
|  `SP-S2004`  |  RDS Custom Agent Login  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: An unexpected issue occurred with the SQL login `"$HOSTNAME/RDSAgent”`. To resolve this issue, create a support case.   |  | 
|  `SP-S2005`  |  Timezone  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The timezone on the Amazon EC2 Instance [%s] was changed. You can resolve this by modifying the time zone back to the setting specified during instance creation. If you would like to create an instance with a specific timezone, see the RDS Custom documentation.  |  Run the `Get-Timezone` PowerShell command to confirm the timezone. For more information, see [Local time zone for RDS Custom for SQL Server DB instances](custom-reqs-limits-MS.TimeZone.md).  | 
|  `SP-S2006`  |  High Availability Software Solution Version  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The high availability software solution of the current instance is different from the expected version. To resolve this issue, create a support case.  |  | 
|  `SP-S2007`  |  High Availability Software Solution Configuration  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The configuration settings of the high availability software solution have been modified to unexpected values on the instance %s. To fix this issue, reboot the EC2 instance. When you reboot the EC2 instance, it automatically updates the settings to the required configuration for the high availability software solution.   |    | 
| SP-S2008 |  SQL Server Service   |  The RDS Custom DB instance is set to [Unsupported configuration]: SQLServer (MSSQLServer) service doesn't exist on the host. To resolve this, create a support case.  |  You can use the following commands to view the agent status. <pre>$name = "MSSQLServer"<br />$service = Get-Service $name<br />Write-Host $service.Status</pre>  | 
| SP-S2009 | SSL Certificate |  The RDS Custom DB instance is set to [Unsupported configuration] because of: Non self-signed SSL certificate(s) causing disruption in RDS. To resolve this issue, remove the non self-signed certificate(s) from the trusted root certificate store.  |  Run the following PowerShell command to review non self-signed certificate(s). <pre>Get-ChildItem cert:\LocalMachine\root -Recurse | Where-Object {$_.Issuer -ne $_.Subject -and $_.Issuer -notlike "*RDSCustomAgentCA*"}</pre> For more information, see [ HTTP Error 403.16 when you try to access a website that's hosted on IIS](https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/site-behavior-performance/http-403-forbidden-access-website).  | 
| SP-S2010 | Root Volume Storage Status |  The RDS Custom DB instance is set to [Unsupported configuration] because of: Root volume storage is full. To resolve this issue, free up at least 500 MiB of storage space in the root EBS volume "volume-id" or increase the volume size and resize the C drive on the EC2 instance "instance-id". The root volume size changes do not persist when you replace the EC2 instance.  |  Use the following command to view available storage on the root (C:) volume. <pre>(Get-PSDrive -Name C).Free / 1MB</pre> For more information on modifying the EBS root volume, see [How](https://forums.aws.amazon.com/knowledge-center/expand-ebs-root-volume-windows)  | 

**Database**


| Event Code | Configuration area | RDS event message | Validation process | 
| --- | --- | --- | --- | 
|  `SP-S3001`  |  SQL Server Shared Memory Protocol  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The SQL Server shared memory protocol is disabled. You can resolve this by enabling the shared memory protocol in SQL Server Configuration Manager.  |  You can validate this by checking: **SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for MSSQLSERVER> Shared Memory** as Enabled. After you enable the protocol, restart the SQL Server process.  | 
|  `SP-S3002`  |  Service Master Key  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: RDS Automation is unable to take the backup of Service Master Key (SMK) as part of the new SMK generation. To resolve this issue, create a support case.  |    | 
|  `SP-S3003`  |  Service Master Key  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The metadata related to the Service Master Key (SMK) is missing or incomplete. To resolve this issue, create a support case.  |    | 
|  `SP-S3004`  |  DB Engine Version and Edition  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: There is a mismatch between the expected and installed SQL Server version and edition: Modifying the SQL Server edition is not supported on RDS Custom for SQL Server. Also, manually changing the SQL Server version on the RDS Custom EC2 instance is not supported. To resolve this issue, create a support case.   |   Run the following query to get the SQL version: <pre>select @@version</pre>  Run the following AWS CLI command to get the RDS SQL engine version and edition: <pre>aws rds describe-db-instances \<br />--db-instance-identifier db-instance-name |grep EngineVersion<br />aws rds describe-db-instances \<br />--db-instance-identifier db-instance-name |grep Engine</pre> For more information, see [Modifying an RDS Custom for SQL Server DB instance](custom-managing.modify-sqlserver.md) and [Upgrading a DB instance engine version](USER_UpgradeDBInstance.Upgrading.md).  | 
|  `SP-S3005`   |  DB Engine Edition  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The current SQL Server edition doesn't match the expected SQL Server edition [%s]: Modifying the SQL Server edition is not supported on RDS Custom for SQL Server. To resolve this issue, create a support case.  |   Run the following query to get the SQL edition: 

**Example**  

```
select @@version
```  Run the following AWS CLI command to get the RDS SQL engine edition: <pre>aws rds describe-db-instances \<br />--db-instance-identifier db-instance-name |grep Engine</pre>  | 
|  `SP-S3006`   |  DB Engine Version  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The current SQL Server version doesn't match the expected SQL Server version [%s]: You can't manually change the SQL Server version on the RDS Custom EC2 instance. To resolve this issue, create a support case. For any future modifications to SQL Server version, you can modify the instance from the AWS RDS console or through the modify-db-instance CLI command.  |   Run the following query to get the SQL version: 

**Example**  

```
select @@version
```  Run the following AWS CLI command to get the RDS SQL engine version: <pre>aws rds describe-db-instances \<br />--db-instance-identifier db-instance-name |grep EngineVersion</pre> For more information, see [Modifying an RDS Custom for SQL Server DB instance](custom-managing.modify-sqlserver.md) and [Upgrading a DB instance engine version](USER_UpgradeDBInstance.Upgrading.md).  | 
|  `SP-S3007`  |  Database file location  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: Database files are configured outside of the D:\$1 drive. You can resolve this by making sure that all database files, including ROW, LOG, FILESTREAM, etc... are stored on the D:\$1 drive.  |  Run the following query to list the location of database files that aren't in the default path: <pre>USE master;<br />SELECT physical_name as  files_not_in_default_path<br />FROM sys.master_files<br />WHERE SUBSTRING(physical_name,1,3)!='D:\';<br /></pre>  | 
|  `SP-S3008`  |  Database Count Limit Exceeded  |  The RDS Custom DB instance status is set to [Unsupported configuration] because of: The total number of databases on the DB instance exceeds the maximum limit of 5000. To resolve this, reduce the number of databases below the maximum supported limit.  |  Use the following command to view total database count: <pre>SELECT COUNT(name) as databaseCount<br />FROM sys.databases<br />WHERE name not in ('tempdb','master','model','msdb','DWDiagnostics','DWConfiguration','DWQueue');</pre>  | 

## Troubleshooting `Storage-Full` in RDS Custom for SQL Server
<a name="custom-troubleshooting-storage-full"></a>

RDS Custom also monitors the root (C:) volume. The RDS Custom for SQL Server DB instance moves to the `unsupported-configuration` state when the root volume has less than 500 MiB disk space available. See `Event SP-S2010` in [Fixing unsupported configurations in RDS Custom for SQL Server](#custom-troubleshooting-sqlserver.fix-unsupported).

## Troubleshooting PENDING\$1RECOVERY state for TDE enabled databases in RDS Custom for SQL Server
<a name="custom-troubleshooting-sqlserver.pending_recovery"></a>

SQL Server databases with transparent data encryption (TDE) enabled might remain in `PENDING_RECOVERY` state if the automatic decryption runs into issues. This typically occurs after a DB instance restore if the source DB instance Service Master Key (SMK) backup file stored in the RDS Custom managed S3 bucket in your account has been deleted prior to the restore completion.

To enable the automatic decryption and bring the TDE enabled databases online, you need to open the Database Master Key (DMK) with its password and ecrypt the DMK using the SMK.

Use the following SQL Server commands for reference:

```
-- Identify PENDING_RECOVERY TDE databases
USE MASTER;
GO
SELECT name, is_encrypted, state_desc FROM sys.databases;
GO

-- Open DMK using password
OPEN MASTER KEY DECRYPTION BY PASSWORD = '<password>';
GO

-- Encrypt DMK using SMK
ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY;
GO

-- Close SMK
CLOSE MASTER KEY;
GO

-- Bring the TDE databases online
ALTER DATABASE <database_name> SET ONLINE;
GO

-- Verify TDE databases are now in ONLINE state
SELECT name, is_encrypted, state_desc FROM sys.databases;
GO
```