Skip to content

frostmoln_mysql_read_replica (Resource)

Manages a read replica of a managed MySQL instance. Read replicas are immutable after creation.

Example Usage

terraform
resource "frostmoln_mysql_read_replica" "reader" {
  instance_id = frostmoln_mysql_instance.main.id
  name        = "mysql-reader-1"
}

output "mysql_reader_endpoint" {
  value = "${frostmoln_mysql_read_replica.reader.private_ip}:${frostmoln_mysql_read_replica.reader.port}"
}

Schema

Required

  • instance_id (String) The ID of the primary MySQL instance to replicate.
  • name (String) The name of the read replica.

Optional

  • flavor_id (String) Flavor ID sizing the replica (e.g. db.gp1.small). Optional; when omitted the replica inherits the primary's flavor, which is returned as the computed value. Immutable — changing it replaces the replica.

Read-Only

  • id (String) The unique identifier of the read replica.
  • port (Number) The port number the read replica is listening on.
  • private_ip (String) The private IP address of the read replica.
  • replication_lag_bytes (Number) The replication lag in bytes between primary and replica.
  • status (String) The current status of the read replica.