alicloud_gpdb_db_instance_plan

Provides a AnalyticDB for PostgreSQL (GPDB) DB Instance Plan resource.

For information about AnalyticDB for PostgreSQL (GPDB) DB Instance Plan and how to use it, see What is DB Instance Plan.

Example Usage

Basic Usage

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

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

data "alicloud_gpdb_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_gpdb_zones.default.ids.0
}

resource "alicloud_gpdb_instance" "default" {
  db_instance_category  = "HighAvailability"
  db_instance_class     = "gpdb.group.segsdx1"
  db_instance_mode      = "StorageElastic"
  description           = var.name
  engine                = "gpdb"
  engine_version        = "6.0"
  zone_id               = data.alicloud_gpdb_zones.default.ids.0
  instance_network_type = "VPC"
  instance_spec         = "2C16G"
  master_node_num       = 1
  payment_type          = "PayAsYouGo"
  private_ip_address    = "1.1.1.1"
  seg_storage_type      = "cloud_essd"
  seg_node_num          = 4
  storage_size          = 50
  vpc_id                = data.alicloud_vpcs.default.ids.0
  vswitch_id            = data.alicloud_vswitches.default.ids[0]
  ip_whitelist {
    security_ip_list = "127.0.0.1"
  }
}

resource "alicloud_gpdb_db_instance_plan" "default" {
  db_instance_plan_name = var.name
  plan_desc             = var.name
  plan_type             = "PauseResume"
  plan_schedule_type    = "Regular"
  plan_config {
    resume {
      plan_cron_time = "0 0 0 1/1 * ? "
    }
    pause {
      plan_cron_time = "0 0 10 1/1 * ? "
    }
  }
  db_instance_id = alicloud_gpdb_instance.default.id
}

Argument Reference

The following arguments are supported:

plan_config

The plan_config supports the following:

plan_config-resume

The resume supports the following:

plan_config-pause

The pause supports the following:

plan_config-scale_in

The scale_in supports the following:

plan_config-scale_out

The scale_out supports the following:

Attributes Reference

The following attributes are exported:

Timeouts

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

Import

GPDB DB Instance Plan can be imported using the id, e.g.

$ terraform import alicloud_gpdb_db_instance_plan.example <db_instance_id>:<plan_id>