IaC Bazaar
Oracle CloudPlan-validated

MySQL HeatWave DB System

Managed MySQL with optional HeatWave analytics cluster, HA, backups, configuration and inbound replication channel.

terraformOracle Cloud#oci

Compare Managed Relational Database across clouds →

oci-mysql-heatwaveterraform v1.7

Verification

Plan-validated

Passed: module logic verified on a mocked plan — inputs, validation rules, conditional creation and outputs resolve (no real provider, no cloud).

Conformance

  • Static validation (fmt · validate · tflint)
  • Security scan clean (Checkov)
  • Plan tests (mocked: validation rules · outputs)

Provenance

  • SHA-256 checksum
  • Signature (pending)

Functional

  • Live test pending (no cloud run yet)

Last verified 2026-06-28 · how we verify

Documentation

oci-mysql-heatwave

Status: static-validated, live-test pending. Ships under live-test quarantine — no OCI cloud sandbox is wired into CI yet, so the live apply → verify → destroy gate has not run. Static validation (fmt, validate, tflint) passes.

Managed MySQL HeatWave DB System for OCI: a VCN-private MySQL with optional HeatWave analytics cluster, optional 3-node HA, automatic backups with point-in-time recovery, an optional dedicated server configuration, and an optional inbound replication channel. Works with Terraform and OpenTofu (>= 1.6), OCI provider >= 8.0, < 9.0.

Secure defaults

  • No public endpoint. MySQL HeatWave is reachable only from inside the VCN; this module places the system in a private subnet and prefers NSGs (nsg_ids) for a deny-by-default data plane.
  • Encryption at rest is always on (OCI-managed); TLS in transit is available with secure_connections_certificate_id (BYOC) or the Oracle SYSTEM certificate by default.
  • Automatic backups + PITR on by default (7-day retention), with explicit deletion safety: is_delete_protected, final_backup_on_delete and automatic-backup retention on delete.
  • Crash recovery on (InnoDB redo + double-write) for durability.
  • Replication is encrypted by default (source_ssl_mode = REQUIRED).
  • shape_name = MySQL.Free ships an Always-Free single-node 50 GB system for $0; HA and HeatWave need a paid shape (guarded by preconditions and notes).

Usage

module "mysql" {
  source = "./oci-mysql-heatwave"

  compartment_id      = "ocid1.compartment.oc1..xxxx"
  display_name        = "prod-mysql"
  availability_domain = "Uocm:US-ASHBURN-AD-1"
  subnet_id           = module.vcn.subnet_ids["db"]
  nsg_ids             = [module.vcn.network_security_group_ids["db"]]

  admin_username = "appadmin"
  admin_password = var.mysql_admin_password # inject, never hardcode

  # Paid HA + HeatWave analytics:
  shape_name              = "MySQL.2"
  data_storage_size_in_gb = 100
  is_highly_available     = true

  heatwave_enabled      = true
  heatwave_cluster_size = 2
}

Inputs

NameTypeDefaultDescription
compartment_idstringCompartment OCID (required)
display_namestringDB system display name (required)
subnet_idstringPrivate subnet OCID (required)
availability_domainstringAD of the read/write endpoint (required)
fault_domainstringnullFault domain for the endpoint
shape_namestringMySQL.FreeCompute shape (Always-Free by default)
mysql_versionstringnullMySQL version (null = OCI default)
admin_usernamestringadminAdministrative user
admin_passwordstring (sensitive)8-32 chars, mixed classes (required)
data_storage_size_in_gbnumber50Initial data volume (≥ 50)
is_highly_availableboolfalse3-node HA group (paid)
hostname_labelstringnullEndpoint DNS hostname label
port / port_xnumber3306 / 33060Classic / X protocol ports
nsg_idslist(string)[]NSGs on the DB system VNIC
crash_recovery_enabledbooltrueInnoDB redo + double-write
database_management_enabledboolfalseDatabase Management monitoring
backup_enabledbooltrueAutomatic backups
backup_retention_in_daysnumber7Backup window (1-35)
backup_window_start_timestringnullHH:MM backup window start
pitr_enabledbooltruePoint-in-time recovery
is_delete_protectedboolfalseBlock deletion until disabled
final_backup_on_deletestringSKIP_FINAL_BACKUPFinal backup on delete
retain_automatic_backups_on_deletestringnullRETAIN / DELETE
maintenance_window_start_timestringnull"<DAY> HH:MM"
storage_auto_expand_enabledboolfalseAuto-expand data volume
storage_max_size_in_gbsnumbernullAuto-expand ceiling
secure_connections_certificate_idstringnullBYOC TLS certificate OCID
create_configurationboolfalseCreate a dedicated server config
configuration_idstringnullUse an existing config OCID
configuration_variablesobject{}Server variables for the created config
heatwave_enabledboolfalseAttach a HeatWave cluster (paid)
heatwave_cluster_sizenumber1HeatWave nodes (1-64)
heatwave_shape_namestringMySQL.HeatWave.VM.StandardHeatWave node shape
heatwave_lakehouse_enabledboolfalseHeatWave Lakehouse
replication_channelobject{}Inbound replication channel config
replication_source_passwordstring (sensitive)nullSource replication user password
freeform_tags / defined_tagsmap(string){}Tags

Outputs

db_system_id, db_system_state, endpoints, ip_address, hostname_label, port, port_x, configuration_id, heatwave_cluster_id, replication_channel_id.

Notes

  • admin_password, replication_source_password and the replication CA live in Terraform state — encrypt and access-control your state backend.
  • HA and HeatWave are not available on the MySQL.Free shape; pick a paid shape for those.
  • create_configuration and configuration_id are mutually exclusive (precondition). configuration_variables are the fixed-name attributes of the provider's variables{} block; null entries fall back to the shape default.
  • Storage auto-expansion requires storage_max_size_in_gbs greater than the initial size (precondition).

Requirements

  • Terraform or OpenTofu >= 1.6
  • Provider oracle/oci >= 8.0, < 9.0

Verification

Static-validated (fmt, validate, tflint). Live apply/destroy testing pending cloud sandbox availability — see catalog status.

License

Commercial — LicenseRef-IaCBazaar-Commercial. © IaC Bazaar. Original work (not derived from a third-party module).