1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
| variable "region" { description = "地域" type = string default = "ap-shanghai" }
variable "instance_name" { description = "kafka实例名" type = string }
variable "availability_zone" { # 如ap-shanghai-2 description = "可用区" type = string }
variable "charge_type" { # PREPAID(预付费), POSTPAID_BY_HOUR(按量付费) description = "kafka实例计费方式" type = string validation { condition = contains(["PREPAID", "POSTPAID_BY_HOUR"], var.charge_type) error_message = "The charge_type must be one of PREPAID, POSTPAID_BY_HOUR" } }
variable "kafka_version" { # 0.10.2/1.1.1/2.4.1/2.8.1 description = "kafka实例版本" type = string validation { condition = contains(["0.10.2", "1.1.1", "2.4.1", "2.4.2", "2.8.1"], var.kafka_version) error_message = "The kafka_version must be one of 0.10.2, 1.1.1, 2.4.1, 2.4.2, 2.8.1" } }
variable "vswitch_id" { // 阿里云vswitch_id -> 腾讯云subnet_id description = "绑定子网id" type = string }
variable "vpc_id" { description = "绑定vpc_id" type = string }
variable "disk_size" { # 需满足当前实例的计费规格,此处预设200和400,可以根据需要修改 description = "kafka实例磁盘规格" type = number validation { condition = contains([200, 400], var.disk_size) error_message = "The disk_size must be one of 200, 400" } }
variable "disk_type" { # 专业版实例磁盘类型,标准版实例不需要填写,CLOUD_SSD(SSD云硬盘), CLOUD_BASIC(高性能云硬盘) description = "kafka专业版实例磁盘类型" type = string default = "" validation { condition = contains(["", "CLOUD_SSD", "CLOUD_BASIC"], var.disk_type) error_message = "The disk_type must be empty, or one of CLOUD_SSD, CLOUD_BASIC" } }
variable "band_width" { # 单位为MBps. description = "kafka实例带宽" type = number }
variable "auto_create_topic_enable" { description = "是否自动创建topic" type = bool default = true validation { condition = contains([true, false], var.auto_create_topic_enable) error_message = "The auto_create_topic_enable must be one of true, false" } }
variable "num_partitions" { description = "kafka实例默认分区数" type = number default = 3 }
variable "replication_factor" { description = "kafka实例默认副本数" type = number default = 2 }
variable "dynamic_retention_config_enable" { description = "是否启用动态消息保留时间配置" type = number default = 0 validation { condition = contains([0, 1], var.dynamic_retention_config_enable) error_message = "The dynamic_retention_config_enable must be one of 0, 1" } }
variable "msg_retention_time" { # 以分钟为单位 description = "kafka实例日志的最大保留时间" type = number default = 10080 }
variable "partition" { description = "kafka实例分区大小" type = number default = 3 }
|