From 5d094ab05762c64d5a87b378c34fecc37f3f725c Mon Sep 17 00:00:00 2001 From: shanye Date: Wed, 30 Jul 2025 17:07:24 +0800 Subject: [PATCH] feat: support attribute system_disk_category, size, performance_level and internet_charge_type --- main.tf | 26 +++++++++++++++----------- variables.tf | 26 +++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/main.tf b/main.tf index 9697f4b..5d9422f 100644 --- a/main.tf +++ b/main.tf @@ -3,17 +3,21 @@ module "instances" { source = "alibaba/ecs-instance/alicloud" version = "2.12.0" - number_of_instances = var.create_instance ? var.number_of_instance : 0 - image_id = var.image_id - instance_type = var.instance_type - use_num_suffix = var.use_num_suffix - security_group_ids = var.security_groups - vswitch_id = var.vswitch_id - user_data = local.user_data - password = var.instance_password - associate_public_ip_address = var.associate_public_ip_address - internet_max_bandwidth_out = var.internet_max_bandwidth_out - tags = var.tags + number_of_instances = var.create_instance ? var.number_of_instance : 0 + image_id = var.image_id + instance_type = var.instance_type + internet_charge_type = var.internet_charge_type + system_disk_category = var.system_disk_category + system_disk_size = var.system_disk_size + system_disk_performance_level = var.system_disk_performance_level + use_num_suffix = var.use_num_suffix + security_group_ids = var.security_groups + vswitch_id = var.vswitch_id + user_data = local.user_data + password = var.instance_password + associate_public_ip_address = var.associate_public_ip_address + internet_max_bandwidth_out = var.internet_max_bandwidth_out + tags = var.tags } resource "alicloud_log_machine_group" "this" { diff --git a/variables.tf b/variables.tf index bc5739e..591a853 100644 --- a/variables.tf +++ b/variables.tf @@ -24,6 +24,30 @@ variable "instance_type" { default = "" } +variable "system_disk_category" { + description = "The system disk category used to launch one or more ecs instances." + type = string + default = null +} + +variable "system_disk_size" { + description = "The system disk size used to launch one or more ecs instances." + type = number + default = null +} + +variable "system_disk_performance_level" { + description = "The performance level of the ESSD used as the system disk, Valid values: `PL0`, `PL1`, `PL2`, `PL3`, Default to `PL1`." + type = string + default = null +} + +variable "internet_charge_type" { + description = "The internet charge type of instance. Choices are 'PayByTraffic' and 'PayByBandwidth'." + type = string + default = null +} + variable "use_num_suffix" { description = "Always append numerical suffix(like 001, 002 and so on) to instance name and host name, even if number_of_instances is 1." type = bool @@ -138,4 +162,4 @@ variable "log_machine_identify_type" { description = "The machine identification type, including IP and user-defined identity. Valid values are 'ip' and 'userdefined'. Default to 'ip'." type = string default = "ip" -} \ No newline at end of file +}