Skip to content

frostmoln_mysql_instance (Resource) ​

Manages a managed MySQL database instance in the Frostmoln platform.

Destroying an instance is refused while a restore FROM it to another instance is still running (deleting the source would fail that restore). The provider reports it and does not wait: let the restore target reach running or error, then destroy again.

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 — ha_enabled, subnet_id, version, vpc_id: the platform has no in-place migration for it — a change re-creates the instance.

Create-only, change refused (not replaced) — parameter_group_id: the platform stores the parameter group reference but its parameter-apply is an unimplemented stub — the values never reach the running server on create or on update, so any value is refused outright at plan and apply instead of recorded as intent that is not enacted.

Observed, not enacted — private_ip: platform-assigned from the subnet at create. public_ip: platform-assigned where the offer exposes one. 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_instance" "main" {
  name       = "my-mysql-db"
  version    = "8.4"
  flavor_id  = "db.gp1.small"
  storage_gb = 50
  vpc_id     = frostmoln_vpc.main.id
  subnet_id  = frostmoln_subnet.db.id

  backup_enabled        = true
  backup_schedule       = "0 2 * * *"
  backup_retention_days = 35

  # 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_endpoint" {
  value = "${frostmoln_mysql_instance.main.private_ip}:${frostmoln_mysql_instance.main.port}"
}

Schema ​

Required ​

  • flavor_id (String) The flavor ID/size for the database instance (e.g. "db.gp1.small", "db.gp1.medium").
  • name (String) The name of the MySQL instance.
  • storage_gb (Number) The storage size in gigabytes. Can be increased in place (online resize); decreasing it is not supported.
  • subnet_id (String) The subnet ID where the database instance will be deployed.
  • version (String) The MySQL version (e.g. "8.0", "8.4", "9.2").
  • vpc_id (String) The VPC ID where the database instance will be deployed.

Optional ​

  • backup_enabled (Boolean) Whether automated backups are enabled.
  • backup_retention_days (Number) Number of days to retain backups. Minimum 35 (backups are immutably object-locked for 35 days); maximum 90. Defaults to 35 server-side.
  • backup_schedule (String) Cron expression for the backup schedule. Defaults to "0 2 * * *" server-side.
  • ha_enabled (Boolean, Deprecated) Not supported for MySQL. High availability is available for PostgreSQL only; setting this to true is rejected.
  • parameter_group_id (String) The ID of the parameter group to reference on the instance. The platform stores the reference but never applies it — its parameter-apply endpoint is an unimplemented stub, so the group's values never reach the running server on create or on update. Setting it is refused at plan time, with the constraint and remedy in the refusal terraform prints; leave it unset until the platform ships a working apply path.
  • tags (Map of String) Resource tags on the instance: your own key/value metadata for search and filtering (?tag=key=value in the API, --tag in the fm CLI), stored by the platform only and never applied to the database server. Changing them updates the instance in place and does not restart or reconfigure 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 ​

  • admin_username (String) The admin username for the MySQL instance.
  • created_at (String) The timestamp when the instance was created.
  • ha_status (String) Availability state of the instance. Always "disabled" for MySQL, which does not support high availability.
  • id (String) The unique identifier of the MySQL instance.
  • port (Number) The port number the MySQL instance is listening on.
  • private_ip (String) The private IP address of the MySQL instance.
  • public_ip (String) The public IP address, if assigned.
  • status (String) The current status of the MySQL instance.
  • 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.
  • tenant_id (String) The tenant ID that owns this instance.
  • updated_at (String) The timestamp when the instance was last updated.

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").