Skip to main content

MySQL DbaaS

Provides an e2e DBaaS MySQL resource. This resource allows you to manage MySQL DBaaS on your e2e clusters. When applied, a new MySQL DBaaS is created. When destroyed, this MySQL DBaaS is removed.

Example Usage

resource "e2e_dbaas_mysql" "db1" {
location = "Delhi"
project_id = 12345 # Replace with your actual project ID
plan = "DBS.16GB"
version = "8.0"
dbaas_name = "mydbname"
parameter_group_id = 123 # Optional, Replace with your parameter group id.
size = 250 # Optional, additional disk size (in GB) which you want to attach after node is created.

database {
user = "admin" # Replace this with the username you want to have for your DB
password = "SecurePassword@12345678" # Replace this with the password you want to have for your DB
name = "mydb"
}

vpcs = [e2e_vpc.VPC-TS-01.id] # Optional, add VPC ID(s) only if you want to attach vpc
}

resource "e2e_vpc" "VPC-TS-01" {
location = "Delhi"
vpc_name = "VPC-TS-01"
project_id = 12345 # Replace with your actual project ID
}

Schema

Required Attributes

  • location (String) The location (region) where the DBaaS will be deployed.
  • project_id (Number) Your project ID in which the DBaaS is to be created. To find the project ID, please refer to our API Documentation
  • plan (String) The DBaaS plan name (e.g., DBS.16GB). To find available plans, refer to the API Documentation
  • version (String) Version of MySQL to be deployed (e.g., 8.0).
  • dbaas_name (String) Name of the DBaaS instance.
  • database (Block) Contains DB user credentials and DB name (see below for nested schema).
  • vpcs (List of Number) List of VPC IDs to be attached to the DBaaS. To find VPC IDs, refer to our API Documentation

Optional Attributes

  • parameter_group_id (Number) Parameter Group ID (optional). To find available PG IDs, refer to our API Documentation
  • size (Number) Size of the additionally attached disk in GB, this field will be used when you want to use expand_disk option. (Please ensure that your dbaas instance is in STOPPED state before expanding disk).
  • public_ip_required (Boolean) Whether to attach a public IP to the DBaaS instance. (By default it is passed as TRUE, further if you want to remove it please make this option as FALSE and make sure that you have a vpc attached with your dbaas instance before detaching public ip)
  • is_encryption_enabled (Boolean) Whether encryption is enabled for the DBaaS.
  • status (String) Set start (to resume your instance), stop (to stop your instance), or restart (to restart your instance) to control DBaaS state.

Read-Only

  • id (String) The ID of the DBaaS instance.
  • public_ip (String) Public IP address of the DBaaS.
  • private_ip (String) Private IP address of the DBaaS.
  • disk (String) Allocated disk size.
  • ram (String) Allocated RAM.
  • cpu (String) Allocated CPU.
  • database_version (String) Version of the deployed database software.
  • plan_name (String) Plan name of the DBaaS instance.

Nested Schema for database

Required

  • user (String) Database user.
  • password (String) Password for the database user.
  • name (String) Name of the database to be created.