Deploys an Oracle Cloud Infrastructure MySQL HeatWave Database System — a fully managed MySQL database service with optional High Availability across fault domains, automated backups, point-in-time recovery, and read-scaling endpoints. The component manages the DB System resource itself; HeatWave cluster and replication channels are separate OCI resources with independent lifecycles.
What Gets Created
When you deploy an OciMysqlDbSystem resource, OpenMCF provisions:
MySQL DB System — an oci_mysql_mysql_db_system resource in the specified compartment and subnet, placed in a given availability domain on a chosen compute shape. OCI automatically creates a primary read/write endpoint with a private IP address.
High Availability replicas — when isHighlyAvailable is true, three instances are provisioned across different fault domains with automatic failover. Standby instances are not directly accessible.
Automatic backups — when backupPolicy is configured, daily backups run within a 30-minute window with configurable retention. Point-in-time recovery can be enabled via the nested pitrPolicy.
Read endpoint — when readEndpoint is configured and enabled, a separate DNS endpoint distributes read queries across HA replicas for read scaling.
Database Console — when databaseConsole is configured and enabled, a web-based MySQL management UI is available on the specified port.
REST API service — when rest is configured, the MySQL Router REST API is exposed on the specified port.
Prerequisites
OCI credentials configured via environment variables or OpenMCF provider config (API Key, Instance Principal, Security Token, Resource Principal, or OKE Workload Identity)
A compartment OCID where the DB System will be created — either a literal value or a reference to an OciCompartment resource
A subnet OCID in an existing VCN — either a literal value or a reference to an OciSubnet resource
An availability domain name (e.g., Uocm:PHX-AD-1)
A compute shape name (e.g., MySQL.VM.Standard.E4.1.8GB)
This creates a single-instance MySQL DB System with Oracle-managed encryption and the default MySQL configuration for the selected shape. The DB System ID, endpoint hostname, IP address, and port are exported as stack outputs.
Configuration Reference
Required Fields
Field
Type
Description
Validation
compartmentId
StringValueOrRef
OCID of the compartment where the MySQL DB System will be created. Can reference an OciCompartment resource via valueFrom.
Required
availabilityDomain
string
Availability domain for the primary endpoint (e.g., Uocm:PHX-AD-1). Changing this forces recreation.
Min length 1
shapeName
string
Compute shape for the DB System. Determines CPU, memory, and network bandwidth (e.g., MySQL.VM.Standard.E4.1.8GB).
Min length 1
subnetId
StringValueOrRef
OCID of the subnet where the DB System will be placed. Can reference an OciSubnet resource via valueFrom. Changing this forces recreation.
Required
Optional Fields
Field
Type
Default
Description
displayName
string
metadata.name
Human-readable name shown in the OCI Console. Falls back to metadata.name if not provided.
adminUsername
string
—
Administrative username for the database. Changing this forces recreation.
adminPassword
string
—
Administrative password. Must be 8-32 characters with at least one numeric, one lowercase, one uppercase, and one special character. Changing this forces recreation.
mysqlVersion
string
latest
MySQL version identifier (e.g., 8.0.36, 9.1.0). When omitted, the latest available version is used. Changing this forces recreation.
configurationId
StringValueOrRef
—
OCID of a MySQL Configuration defining server variable settings. When omitted, the default configuration for the selected shape is used.
isHighlyAvailable
bool
—
When true, provisions three instances across different fault domains with automatic failover.
hostnameLabel
string
—
Hostname for the primary endpoint. Combined with the subnet's DNS domain to form the FQDN.
ipAddress
string
—
Specific private IP for the primary endpoint. When omitted, OCI auto-assigns. Changing this forces recreation.
faultDomain
string
—
Fault domain for the primary endpoint (e.g., FAULT-DOMAIN-1). Changing this forces recreation.
port
int32
3306
TCP port for the MySQL protocol. Changing this forces recreation.
portX
int32
33060
TCP port for the X Protocol (MySQL Shell, connectors). Changing this forces recreation.
description
string
—
User-provided description of the DB System.
crashRecovery
string
—
Controls InnoDB crash recovery. Values: ENABLED, DISABLED. Disabling improves write performance but risks data loss.
databaseManagement
string
—
Enables monitoring via OCI Database Management service. Values: ENABLED, DISABLED.
nsgIds
StringValueOrRef[]
—
OCIDs of network security groups for the DB System VNIC. Can reference OciSecurityGroup resources.
Production with BYOK Encryption, Deletion Protection, and Read Endpoint
Full production configuration with customer-managed encryption, deletion safeguards, read scaling, NSG attachment, and customer contact notifications:
apiVersion:oci.openmcf.org/v1kind:OciMysqlDbSystemmetadata:name:prod-mysqllabels:openmcf.org/provisioner:pulumipulumi.openmcf.org/organization:my-orgpulumi.openmcf.org/project:my-projectpulumi.openmcf.org/stack.name:prod.OciMysqlDbSystem.prod-mysqlenv:prodorg:acmespec:compartmentId:value:"ocid1.compartment.oc1..example"availabilityDomain:"Uocm:PHX-AD-1"shapeName:"MySQL.VM.Standard.E4.8.128GB"subnetId:value:"ocid1.subnet.oc1.phx..example"adminUsername:"dbadmin"adminPassword:"Pr0d!Str0ng#42"mysqlVersion:"8.0.36"isHighlyAvailable:truehostnameLabel:"prod-mysql"faultDomain:"FAULT-DOMAIN-1"port:3306portX:33060description:"Production MySQL for order processing"crashRecovery:"ENABLED"databaseManagement:"ENABLED"nsgIds:-value:"ocid1.networksecuritygroup.oc1.phx..example"dataStorage:dataStorageSizeInGb:500isAutoExpandStorageEnabled:truemaxStorageSizeInGbs:65536backupPolicy:isEnabled:trueretentionInDays:30windowStartTime:"02:00"pitrPolicy:isEnabled:truemaintenance:windowStartTime:"sun 05:00"maintenanceScheduleType:regularversionPreference:oldestversionTrackPreference:long_term_supportdeletionPolicy:automaticBackupRetention:"RETAIN"finalBackup:"REQUIRE_FINAL_BACKUP"isDeleteProtected:trueencryptData:keyGenerationType:byokkeyId:value:"ocid1.key.oc1.phx..example"secureConnections:certificateGenerationType:system_certcustomerContacts:-email:"dba-team@example.com"-email:"oncall@example.com"readEndpoint:isEnabled:truereadEndpointHostnameLabel:"prod-mysql-ro"databaseConsole:status:enabledport:443
Using Foreign Key References
Reference OpenMCF-managed compartment and subnet instead of hardcoding OCIDs:
After deployment, the following outputs are available in status.outputs:
Output
Type
Description
db_system_id
string
OCID of the MySQL DB System
endpoint_hostname
string
Hostname of the primary (read/write) endpoint
endpoint_ip_address
string
Private IP address of the primary (read/write) endpoint
endpoint_port
string
TCP port of the primary (read/write) endpoint
Related Components
OciVcn — provides the VCN containing the subnet where the DB System is placed
OciSubnet — provides the subnet referenced by subnetId
OciCompartment — provides the compartment referenced by compartmentId
OciSecurityGroup — manages network security rules attached via nsgIds
Next article
OCI Network Firewall
OCI Network Firewall Deploys an Oracle Cloud Infrastructure Network Firewall with an inline firewall policy. The firewall appliance is deployed into a subnet and inspects traffic according to security rules that match on source/destination IP addresses, TCP/UDP ports, and URL patterns. The policy and all sub-resources (address lists, services, service lists, URL lists, security rules) are declared in a single manifest. What Gets Created When you deploy an OciNetworkFirewall resource, OpenMCF...