Create a new Database called “Database” (open SSMS and click create new database) and do a full backup for this database (right click Tasks->Backup).
You don’t need to do this step on the second node, since you will set this database to be part of the AG.
In other cases, it’s best practice to have backup even if you have HA solution.
Open SSMS and create the first Availability group
Add the second instance:
In the Listener tab set both of the IP:
The listener name is the endpoint to which clients \ application are connecting to
Open the SSMS right click and simulate failure
or Hard shutdown the active instance from Amazon EC2 Console
Open dnsmgmt.msc Look for the endpoint record, how many records do you see? How to solve it?
Get-ClusterResource $NetworkName | Set-ClusterParameter RegisterAllProvidersIP 0
When failover, you might notice that the cluster is trying to set the wrong IP on the instance, since only one IP can run on one instance, we can set the cluster to try running those IP only on the instance that is relevant
In the Failover cluster management, click on roles and select the AG role, go to Advanced policies and allow only one node per his subnet