Skip to main content

MariaDb DbaaS

Provides an E2E DBaaS MariaDB resource.

This resource allows you to provision and manage MariaDB clusters on your E2E project.

  • When applied, it creates a new DBaaS instance.
  • When destroyed, the service is terminated.

Example Usage

resource "e2e_dbaas_mariadb" "example" {
name = "my-mariadb-cluster"
location = "Delhi"
project_id = "your-project-id"
software_name = "MariaDB"
software_version = "10.6"
plan_name = "DBS.16GB"
group = "Default"
public_ip_enabled = true
parameter_group_id = 123 # Optional
is_encryption_enabled = true # Optional
encryption_passphrase = "MySecret" # Optional
disk_size = 100 # Optional

database {
user = "admin"
password = "securepassword"
name = "mydb"
dbaas_number = 1
}

vpcs = [e2e_vpc.vpc1.id]
}

resource "e2e_vpc" "vpc1" {
vpc_name = "my-vpc"
location = "Delhi"
project_id = "your-project-id"
}

Schema

Required Attributes

  • name (String): Unique name of the MariaDB cluster.
  • location (String): Region where the cluster will be deployed.
  • project_id (String): Your E2E Cloud project ID.
  • software_name (String): Name of the software (e.g., "MariaDB").
  • software_version (String): Version of MariaDB to deploy (e.g., "10.6").
  • plan_name (String): DBaaS plan (e.g., "DBS.16GB").
  • group (String): Group to which the DB belongs (typically "Default").
  • database (Block): Nested block containing DB credentials and name.

Optional Attributes

  • vpcs (List of String): List of VPC IDs to attach to the DB cluster.
  • public_ip_enabled (Boolean): Whether to attach a public IP (default: true).
  • parameter_group_id (Number): Parameter group ID to attach. Default is 0 (none).
  • is_encryption_enabled (Boolean): Whether to enable encryption at rest (default: false).
  • encryption_passphrase (String, Sensitive): Optional encryption passphrase.
  • disk_size (Number): Additional disk size to expand during update (in GB).
  • status (String): Set RUNNING, STOPPED, or RESTARTING to control DBaaS state.

Read-Only

  • id (String): ID of the MariaDB cluster.
  • software_id (Number): ID resolved from software name + version.
  • template_id (Number): ID resolved from plan + software.
  • public_ip_attached (Boolean): Whether a public IP is currently attached.
  • public_ip_address (String): Assigned public IP.
  • private_ip_address (String): Assigned private IP.
  • port (String): Service port exposed (typically 3306).
  • total_disk_size (Number): Total disk size of the MariaDB instance in GB. Computed after creation and updated after disk expansion.

Nested Schema

Required

  • user (String): Username for the database.
  • password (String, Sensitive): Password for the database.
  • name (String): Name of the database to be created.
  • dbaas_number (Number): Usually 1 for most use cases.