» alicloud_gpdb_instance

Provides a AnalyticDB for PostgreSQL instance resource supports replica set instances only. the AnalyticDB for PostgreSQL provides stable, reliable, and automatic scalable database services. You can see detail product introduction here

» Example Usage

» Create a Gpdb instance

data "alicloud_zones" "default" {
  available_resource_creation = "Gpdb"
}

resource "alicloud_vpc" "default" {
  name       = "vpc-123456"
  cidr_block = "172.16.0.0/16"
}

resource "alicloud_vswitch" "default" {
  availability_zone = "${data.alicloud_zones.default.zones.0.id}"
  vpc_id            = "${alicloud_vpc.default.id}"
  cidr_block        = "172.16.0.0/24"
  name              = "vpc-123456"
}

resource "alicloud_gpdb_instance" "example" {
  description          = "tf-gpdb-test""
  engine               = "gpdb"
  engine_version       = "4.3"
  instance_class       = "gpdb.group.segsdx2"
  instance_group_count = "2"
  vswitch_id           = "${alicloud_vswitch.default.id}"
  security_ip_list     = ["10.168.1.12", "100.69.7.112"]
}

» Argument Reference

The following arguments are supported:

  • engine (Required, ForceNew) Database engine: gpdb. System Default value: gpdb.
  • engine_version - (Required, ForceNew) Database version. Value options can refer to the latest docs CreateDBInstance EngineVersion.
  • instance_class - (Required) Instance specification. see Instance specifications.
  • instance_group_count - (Required) The number of groups. Valid values: [2,4,8,16,32]
  • description - (Optional) The name of DB instance. It a string of 2 to 256 characters.
  • instance_charge_type - (Optional, ForceNew) Valid values are PrePaid, PostPaid,System default to PostPaid.
  • zone_id - (Optional, ForceNew) The Zone to launch the DB instance. it supports multiple zone. If it is a multi-zone and vswitch_id is specified, the vswitch must in one of them. The multiple zone ID can be retrieved by setting multi to "true" in the data source alicloud_zones.
  • vswitch_id - (Optional, ForceNew) The virtual switch ID to launch DB instances in one VPC.
  • security_ip_list - (Optional) List of IP addresses allowed to access all databases of an instance. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).
  • tags - (Optional, Available in v1.55.3+) A mapping of tags to assign to the resource.

» Timeouts

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

  • create - (Defaults to 30 mins) Used when creating the DB instance (until it reaches the initial Running status).

» Attributes Reference

The following attributes are exported:

  • id - The ID of the Instance.

» Import

AnalyticDB for PostgreSQL can be imported using the id, e.g.

$ terraform import alicloud_gpdb_instance.example gp-bp1291daeda44194