Using AWS CLI create and deploy RDS with Multi-AZ and Read Replica

Services Covered

  • RDS RDS
  • Route53 Route 53

Lab description

This lab exercises following concepts with use of AWS CLI commands:

  • Creating RDS Read Replicas
  • Enabling Multi-AZ and backups
  • Promoting a read replica
  • Updating the RDS endpoint in Route 53

Lab diagram

lab99diagram

Lab files

  • AWS_CLI_commands.txt – contains used commands to perform project

Lab date

23-09-2021

Lab source

This lab is part of A Cloud Guru catalog

Lab steps

All the ids for resources are temporary values specific for the lab

  • Enable Multi-AZ Deployment
    aws rds modify-db-instance --db-instance-identifier db-OBWWA4PQF2XPOBVZP7WQ6CUKGI --multi-az
  • Create a Read Replica
    aws rds create-db-instance-read-replica --db-instance-identifier wordpress-rr   --source-db-instance-identifier wordpress
  • Promote the Read Replica and Change the CNAME Records Set in Route 53 to the New Endpoint
    aws rds promote-read-replica 
    --db-instance-identifier wordpress-rr
  • Check the hosted zone resource record sets
    aws route53 list-resource-record-sets --hosted-zone-id Z02351242NWTTQUT6NPRI
  • Get Read Replicas endpoint
    aws rds describe-db-instances --db-instance-identifier wordpress-rr
  • Create ‘change-name.json’ then change the record set in Route 53 hosted zone to the new db
    aws route53 change-resource-record-sets --hosted-zone-id Z02351242NWTTQUT6NPRI --change-batch file://change-name.json

Acknowledgements

Tags:

Leave a Reply