Getting started with Amazon EC2 High Availability for SQL Server
To get started with Amazon EC2 High Availability for SQL Server (SQL HA), perform the following steps:
Topics
Step 1: Set up SSM Agent
The Systems Manager Agent (SSM Agent) must be installed and running on the Amazon EC2 SQL Server instances with the High Availability deployments. The SSM Agent executes an SSM document to determine and report the SQL HA state for the instance.
The SSM Agent is preinstalled, by default, on the Amazon Machine Images (AMIs) for Windows and SQL Server provided by Amazon. For more information, see Amazon Windows AMIs. To check if SSM Agent is correctly configured on your instances, you can use the System Manager console, or call DescribeInstanceInformation to verify the SSM Agent PingStatus is Online. If necessary, you can manually download and install the latest version of SSM Agent on your Amazon EC2 SQL Server instances. For more information, see Manually install the SSM Agent on Amazon EC2 instances for Windows Server.
Step 2: Attach Amazon managed policy to instances
To ensure that your instance has the required IAM permissions, you must attach the following Amazon managed policies to the instance:
-
AWSEC2SqlHaInstancePolicy — grants permissions for SQL HA to execute Amazon Systems Manager (SSM) Run Command document
AWSEC2-DetectSqlHaStateto automatically detect the standby state of your SQL Server instances. -
AmazonSSMManagedInstanceCore — enables Amazon Systems Manager service core functionality.
For more information, see Attach an IAM role to an Amazon EC2 instance.
Note
If needed, you can create and attach your own custom IAM role. However, at a minimum, the role must include all of the permissions that are included in the AWSEC2SqlHaInstancePolicy Amazon managed policy.
Step 3: (Optional) Store SQL Server credentials in Amazon Secrets Manager
By default, Amazon Systems Manager uses the built-in [NT AUTHORITY\SYSTEM]
user to access SQL Server HA metadata. If you choose to use the built-in [NT AUTHORITY\SYSTEM] user,
you may need to configure Windows user permissions to ensure the service can obtain High Availability metadata from your
SQL Server instances. For more information, see Windows
user setup for Amazon EC2 High Availability for SQL Server.
Alternatively, if your security policies have restricted or disabled the
[NT AUTHORITY\SYSTEM] account, you will need to store and use your SQL Server credentials in Amazon Secrets Manager.
For more information, see
Create a secret in Amazon Secrets Manager with appropriate SQL Server permissions.
Step 4: EnableSQL HA license savings
You must enable SQL HA standby detection for Windows SQL Server license-included instances to receive SQL Server license savings. Use one of the following methods: