Read replicas in GCP - Mini Project: Build & Apply
google_sql_database_instance named primary_instance with name = "primary-db-instance", database_version = "MYSQL_8_0", and region = "us-central1". Use the settings block with tier = "db-f1-micro".Use the google_sql_database_instance resource with the exact name primary_instance. Set the name, database_version, and region as specified. Inside settings, set the tier to db-f1-micro.
instance_region with default = "us-central1".Define a variable named instance_region with the default value "us-central1". Then update the region in the primary instance resource to use var.instance_region.
google_sql_database_instance named read_replica with name = "read-replica-instance", region = var.instance_region, and database_version = "MYSQL_8_0". Add a replica_configuration block with replica_name = "read-replica-1" and primary_instance_name = google_sql_database_instance.primary_instance.name. Use the settings block with tier = "db-f1-micro".Create a new resource named read_replica of type google_sql_database_instance. Set the name, region, and database_version. Inside replica_configuration, set replica_name and link to the primary instance using primary_instance_name. Add settings with the tier.
backup_configuration block to google_sql_database_instance.primary_instance with enabled = true. Also add a maintenance_window block with day = 7, hour = 3, and update_track = "stable".Inside the primary_instance resource, add a backup_configuration block with enabled = true. Also add a maintenance_window block with the specified day, hour, and update_track values.