Skip to content

Commit 4c5d811

Browse files
committed
feat: add attribute category for db instance
1 parent bcfb816 commit 4c5d811

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## 1.3.0 (Unreleased)
21
## 1.2.1 (2025-03-14)
32

43
- examples/complete: improve the examples [GH-7](https://github.com/alibabacloud-automation/terraform-alicloud-ecommerce-elasticsearch/pull/7)

examples/complete/main.tf

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
provider "alicloud" {
2+
region = "ap-southeast-5"
3+
}
4+
15
data "alicloud_db_zones" "default" {
26
engine = "MySQL"
37
engine_version = "8.0"
@@ -7,14 +11,16 @@ data "alicloud_db_zones" "default" {
711
}
812

913
data "alicloud_images" "default" {
10-
name_regex = "^centos_6"
14+
instance_type = data.alicloud_instance_types.default.instance_types[0].id
15+
owners = "system"
16+
most_recent = true
1117
}
1218

1319
data "alicloud_instance_types" "default" {
1420
availability_zone = data.alicloud_db_zones.default.zones[0].id
1521
cpu_core_count = 2
1622
memory_size = 8
17-
instance_type_family = "ecs.g6"
23+
instance_type_family = "ecs.g9i"
1824
}
1925

2026
data "alicloud_db_instance_classes" "default" {
@@ -62,7 +68,7 @@ module "example" {
6268
internet_max_bandwidth_out = 0
6369
ecs_password = var.ecs_password
6470
ecs_charge_type = var.ecs_charge_type
65-
disk_category = "cloud_efficiency"
71+
disk_category = "cloud_essd"
6672
system_disk_size = var.system_disk_size
6773

6874
#alicloud_eip_address
@@ -74,6 +80,7 @@ module "example" {
7480
#alicloud_db_instance
7581
engine = "MySQL"
7682
engine_version = "8.0"
83+
category = "Basic"
7784
instance_type = data.alicloud_db_instance_classes.default.instance_classes[1].instance_class
7885
instance_storage = var.instance_storage
7986
instance_charge_type = var.instance_charge_type

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ resource "alicloud_db_instance" "rds" {
9898
instance_type = var.instance_type
9999
instance_storage = var.instance_storage
100100
instance_charge_type = var.instance_charge_type
101+
category = var.category
101102
db_instance_storage_type = var.db_storage_type
102103
zone_id = var.rds_zone_id
103104
vswitch_id = element(split(",", join(",", alicloud_vswitch.vswitch[*].id)), 1)

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ variable "instance_charge_type" {
209209
default = "Postpaid"
210210
}
211211

212+
variable "category" {
213+
description = "The category of the rds instance."
214+
type = string
215+
default = null
216+
}
217+
212218
variable "db_storage_type" {
213219
description = "The DB instance storage type."
214220
type = string

0 commit comments

Comments
 (0)