پرش به مطلب اصلی

arvancloud_dbaas_mysql_primary_instance (Resource)

Manages a primary MySQL database instance on Arvancloud DBaaS.

After create and after resize, the provider waits until the instance is ACTIVE and hasFirstFullBackup is true (up to ~45 minutes each). Changing flavor_ref or volume_size resizes the instance. Changing tags applies updates in place. Most other arguments force replacement when changed.

Example Usage

resource "arvancloud_dbaas_mysql_primary_instance" "example" {
name = "tf-mysql-primary"
availability_zone = "ir-thr-ba1"
flavor_ref = "g2-4-2-0"
datastore_version = "8.0"
volume_size = 50
tags = ["tf", "mysql"]
}

Schema

Required

  • availability_zone (String) Composite AZ sent as az (e.g. ir-thr-ba1, from arvancloud_dbaas_datacenters availability_zone).
  • datastore_version (String) MySQL engine version (e.g. 8.4.11).
  • flavor_ref (String) Flavor reference (e.g. g2-4-2-0). Updates call the resize API when this value changes.
  • name (String) Cluster/instance name in DBaaS.
  • volume_size (Number) Disk size in GB for the primary volume. Updates call the resize API when this value changes.

Optional

  • support_legacy_mode (Boolean) Passes supportLegacyMode when set.
  • tags (List of String) Optional string tags attached to the instance. Changes update in place via PATCH /instances/{id}/tags (empty list clears tags).

Read-Only

  • created_at (String) Creation timestamp from the API (createDate).
  • datastore_engine (String) Always mysql for this resource (API datastoreType).
  • engine_port (String) Database engine port.
  • flavor_cpu (Number) vCPU count from the provisioned flavor.
  • flavor_disk_gb (Number) Disk size in GB from the flavor object returned by the API.
  • flavor_iops (Number) IOPS from the provisioned flavor.
  • flavor_ram_gb (Number) RAM in GB from the provisioned flavor.
  • id (String) Stable instance id (API id). Survives failovers and HA; used in GET/DELETE paths.
  • intrinsic_id (String) Unique id of the currently provisioned node (API intrinsicId). Changes after failover.
  • node_type (String) Always PRIMARY for this resource.
  • status (String) Lifecycle status from the API (e.g. BUILD, ACTIVE).