Amazon EBS multi-AZ volumes: write in one zone, fail over, read in the other
One volume ID, two Availability Zones. One API call moves the active replica; the script deletes everything it made.
AWS Cloud
Region us-east-1
VPC field-kit-ebs-multi-az-volumes
Subnet, first zone use1-az1
Subnet, second zone use1-az2
One multi-AZ volume, one volume ID: gp3, 1 GiB, encrypted
Presenter
quickstart.py
Amazon EC2 API
CreateVolume, FailoverVolumes
Systems Manager
Run Command, no SSH
Instance 1
writes the marker
Instance 2
reads the marker
Active replica
Standby replica
synchronous replication
failover swaps the roles
1
2
3
4
1
2
3
4
5
LINES
EC2 API calls
Shell commands through Systems Manager
Volume attachment
Replication
FLOW
The script creates the network, a role, the multi-AZ volume and one instance per zone.
The volume is attached to both instances. Instance 1 formats it and writes a marker file.
FailoverVolumes promotes the standby replica; the zones swap.
Instance 2 mounts the same volume and reads the marker.
The script deletes everything it created.