Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
## 1.3.0 (Unreleased)
## 1.2.1 (2025-03-14)

- examples/complete: improve the examples [GH-7](https://github.com/alibabacloud-automation/terraform-alicloud-ecommerce-elasticsearch/pull/7)
Expand Down
13 changes: 10 additions & 3 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
provider "alicloud" {
region = "ap-southeast-5"
}

data "alicloud_db_zones" "default" {
engine = "MySQL"
engine_version = "8.0"
Expand All @@ -7,14 +11,16 @@ data "alicloud_db_zones" "default" {
}

data "alicloud_images" "default" {
name_regex = "^centos_6"
instance_type = data.alicloud_instance_types.default.instance_types[0].id
owners = "system"
most_recent = true
}

data "alicloud_instance_types" "default" {
availability_zone = data.alicloud_db_zones.default.zones[0].id
cpu_core_count = 2
memory_size = 8
instance_type_family = "ecs.g6"
instance_type_family = "ecs.g9i"
}

data "alicloud_db_instance_classes" "default" {
Expand Down Expand Up @@ -62,7 +68,7 @@ module "example" {
internet_max_bandwidth_out = 0
ecs_password = var.ecs_password
ecs_charge_type = var.ecs_charge_type
disk_category = "cloud_efficiency"
disk_category = "cloud_essd"
system_disk_size = var.system_disk_size

#alicloud_eip_address
Expand All @@ -74,6 +80,7 @@ module "example" {
#alicloud_db_instance
engine = "MySQL"
engine_version = "8.0"
category = "Basic"
instance_type = data.alicloud_db_instance_classes.default.instance_classes[1].instance_class
instance_storage = var.instance_storage
instance_charge_type = var.instance_charge_type
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ resource "alicloud_db_instance" "rds" {
instance_type = var.instance_type
instance_storage = var.instance_storage
instance_charge_type = var.instance_charge_type
category = var.category
db_instance_storage_type = var.db_storage_type
zone_id = var.rds_zone_id
vswitch_id = element(split(",", join(",", alicloud_vswitch.vswitch[*].id)), 1)
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ variable "instance_charge_type" {
default = "Postpaid"
}

variable "category" {
description = "The category of the rds instance."
type = string
default = null
}

variable "db_storage_type" {
description = "The DB instance storage type."
type = string
Expand Down
Loading