alicloud_gpdb_database

更新时间:

Provides a GPDB Database resource.

For information about GPDB Database and how to use it, see What is Database.

-> NOTE: Available since v1.232.0.

Example Usage

Basic Usage


variable "name" {
  default = "terraform-example"
}

provider "alicloud" {
  region = "cn-beijing"
}

resource "alicloud_vpc" "default35OkxY" {
  cidr_block = "192.168.0.0/16"
}

resource "alicloud_vswitch" "defaultl8haQ3" {
  vpc_id     = alicloud_vpc.default35OkxY.id
  zone_id    = "cn-beijing-h"
  cidr_block = "192.168.1.0/24"
}

resource "alicloud_gpdb_instance" "defaultTC08a9" {
  instance_spec         = "2C8G"
  seg_node_num          = "2"
  seg_storage_type      = "cloud_essd"
  instance_network_type = "VPC"
  db_instance_category  = "Basic"
  payment_type          = "PayAsYouGo"
  ssl_enabled           = "0"
  engine_version        = "6.0"
  engine                = "gpdb"
  zone_id               = "cn-beijing-h"
  vswitch_id            = alicloud_vswitch.defaultl8haQ3.id
  storage_size          = "50"
  master_cu             = "4"
  vpc_id                = alicloud_vpc.default35OkxY.id
  db_instance_mode      = "StorageElastic"
}


resource "alicloud_gpdb_database" "default" {
  character_set_name = "UTF8"
  owner              = "adbpgadmin"
  description        = "go-to-the-docks-for-french-fries"
  database_name      = "seagull"
  collate            = "en_US.utf8"
  ctype              = "en_US.utf8"
  db_instance_id     = alicloud_gpdb_instance.defaultTC08a9.id
}

Argument Reference

The following arguments are supported:

  • character_set_name - (Optional, ForceNew) Character set, default value is UTF8
  • collate - (Optional, ForceNew) Database locale parameters, specifying string comparison/collation
  • ctype - (Optional, ForceNew) Database locale parameters, specifying character classification/case conversion rules
  • database_name - (Required, ForceNew) Database Name
  • db_instance_id - (Required, ForceNew) Instance ID
  • description - (Optional, ForceNew) Database Description
  • owner - (Required, ForceNew) Data Sheet owner

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource supplied above.The value is formulated as <db_instance_id>:<database_name>.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 5 mins) Used when create the Database.
  • delete - (Defaults to 5 mins) Used when delete the Database.

Import

GPDB Database can be imported using the id, e.g.

$ terraform import alicloud_gpdb_database.example <db_instance_id>:<database_name>