描述
用于占位的 resource,无实际部署动作,可用于改变资源的部署批次
示例
resource "random_password" "db" {length = 16override_special = "_+-&=!@#$%^*()"}resource "cloudapp_placeholder" "db-placeholder" {text = "用于增加 mysql 的部署批次"}resource "tencentcloud_instance" "main" {availability_zone = var.app_target.availability_zoneimage_id = "img-eb30mz89"instance_type = "S6.MEDIUM4"vpc_id = var.app_target.vpc_idsubnet_id = var.app_target.subnet_idtest_text = cloudapp_placeholder.db-placeholder.text}resource "tencentcloud_mysql_instance" "mysql" {availability_zone = var.app_target.availability_zonevpc_id = var.app_target.vpc_idsubnet_id = var.app_target.subnet_idcpu = var.app_plan.cpumem_size = var.app_plan.memoryvolume_size = 50instance_name = "${var.app_name}-mysql"engine_version = "5.7"root_password = random_password.db.resultsecurity_groups = [var.app_sg.security_group_id]internet_service = 1slave_deploy_mode = "0"slave_sync_mode = "0"intranet_port = 3306}
参数说明
类型 | 名称 | 数据类型 | 说明 |
必填 | region | string | 地域,如:ap-guangzhou,默认使用 provider 中定义的 region
也可以在 resource 中指定地域,覆盖默认设置 |
可选 | availability_zone | string | 覆盖 BaseSchema 中的必填设置 |
可选 | count | int | 资源数量,默认为 1
如果为 0 则不创建资源 |
可选 | activity_id | int | 计费活动 ID,保留字段 |
可选 | text | string | 文本内容 |
生成 | id | string | 资源实例 ID |
生成 | create_time | string | 资源创建时间 |