Skip to content

frostmoln_mysql_read_replica (Resource) ​

Manages a read replica of a managed MySQL instance. Every attribute except tags (and timeouts) is fixed at creation; changing one replaces the replica.

Authoritative scope — who owns what on this resource, declared in internal/scopedecl and machine-checked against the schema.

Enacted and reconciled — every configurable attribute not listed below: the platform applies it, and a refresh reads the truth back.

Create-immutable — flavor_id, instance_id, name: a replica's source, name and flavor are fixed at create — a change re-creates the replica.

Observed, not enacted — replication_lag_bytes: the live replication position as the platform reports it — it moves continuously. tags_all: keys set outside Terraform — in the portal, by the fm CLI, or stamped by the platform — appear only here and are kept on every apply, never removed.

Example Usage ​

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

  # Resource tags: your own metadata for search and filtering. Merged with
  # the provider's default_tags; changing them updates in place.
  tags = {
    env = "prod"
  }
}

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.
  • tags (Map of String) Resource tags on the read replica itself: your own key/value metadata for search and filtering, stored by the platform only. A replica's tags are its own: they are not copied from the primary instance, and the primary's are not changed. Changing them updates the replica in place and starts no work on it. At most 32 keys including the tenant's default tags, which the platform merges in at create; a key is 1-64 bytes matching ^[a-zA-Z0-9]([a-zA-Z0-9._:/-]*[a-zA-Z0-9])?$, a value at most 256 bytes; keys beginning frostmoln_ or frostmoln- (any case) are reserved. Merged with the provider's default_tags on every write (a key set here wins). Holds only the keys this configuration sets; the full set is in tags_all.
  • timeouts (Block, Optional) (see below for nested schema)

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.
  • tags_all (Map of String) Every tag the platform holds on this resource: the provider's default_tags, this resource's own tags (which win on a shared key), and any key set outside Terraform — in the portal, by the fm CLI, or stamped by the platform. Keys set outside Terraform appear only here and are kept on every apply, never removed.

Nested Schema for timeouts ​

Optional:

  • create (String) How long the provider waits for the create operation to converge before giving up (e.g. "45m", "2h").
  • delete (String) How long the provider waits for the delete to complete before giving up (e.g. "30m").
  • update (String) How long the provider waits for an update (resize, in-place change) to converge before giving up (e.g. "30m").