When you have a set of application servers running in EC2 in an active/passive configuration, the easiest way to failover is to simply update the DNS to point to the second server as soon as it's available to serve requests. If you are using Route 53 to manage your DNS configuration, with the AWS CLI you can make this change in a single command.
- Install the AWS CLI
- Login with an account that has an IAM Policy that gives it access to the Route53 Service
- Get the HostedZoneID for the domain you want to update from the AWS console here: https://console.aws.amazon.com/route53/home#hosted-zones:
The CLI expects the change to be submitted via a JSON-formatted configuration file. I've inclu