alicloud_adb_account

Provides a ADB account resource and used to manage databases.

Example Usage

variable "creation" {
  default = "ADB"
}

variable "name" {
  default = "tfexample"
}

data "alicloud_adb_zones" "default" {}

data "alicloud_vpcs" "default" {
  name_regex = "^default-NODELETING$"
}
data "alicloud_vswitches" "default" {
  vpc_id  = data.alicloud_vpcs.default.ids.0
  zone_id = data.alicloud_adb_zones.default.ids.0
}

locals {
  vswitch_id = data.alicloud_vswitches.default.ids.0
}

resource "alicloud_adb_db_cluster" "cluster" {
  db_cluster_category = "MixedStorage"
  mode                = "flexible"
  compute_resource    = "8Core32GB"
  vswitch_id          = local.vswitch_id
  description         = var.name
}

resource "alicloud_adb_account" "default" {
  db_cluster_id       = alicloud_adb_db_cluster.cluster.id
  account_name        = var.name
  account_password    = "tf_example123"
  account_description = var.name
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Import

ADB account can be imported using the id, e.g.

$ terraform import alicloud_adb_account.example am-12345:tf_account