# <package.yaml># Custom installation parameters, declare the installation form to be retrieved through the widget.args:- name: app_targetlabel: target networkwidget: subnet-select- name: cvm_typelabel: Cloud Virtual Machine (CVM) typewidget: cvm-instance-type-selectregion: ${app_target.region}zone: ${app_target.subnet.zone}- name: sglabel: security groupwidget: security-group-selectregions:- ${app_target.region}

Field | Description |
args | Declare a parameter list with args. Each item is a parameter. The installation interface will render installation components in the declared order. |
args[i].name | Parameter identification. This is also the variable name to be declared and used in Terraform subsequently. |
args[i].label | Parameter name. The installation interface will show the parameter name. |
args[i].widget | The installation components for parameter use. For supported components, see Installation Parameter Manual. |
args[i].region args[i].zone ... | The configuration of installation components for parameters. Different component types have different configuration fields. See Installation Parameter Manual for details. The configuration of components generally provides a finer selection range when users enter data. For example, after the user has selected the target network, the server type can be limited to the example type range supported by the target subnet to avoid invalid selections. |
args[i].when | (Advanced usage) Conditions for the occurrence of parameters. Parameters do not appear in the installation interface by default and only appear when the conditions of when are met. Applicable to the form linkage of installation components. |
args[i].hidden | (Advanced usage) Conditions for hiding parameters. Parameters will appear in the installation interface by default and hide when the conditions of when are met. Applicable to the form linkage of installation components. |
args[i].validator | (Advanced usage) Verification rules for parameters can help users reduce configuration errors. |
# <variable.tf># CVM model selection variablevariable "cvm_type" {type = object({region = stringregion_id = stringzone = stringinstance_type = string})}
# <deployment.tf>resource "tencentcloud_instance" "demo_cvm" {# CVM modelinstance_type = var.cvm_type.instance_type}
# <variable.tf># CVM model selection variablevariable "cvm_type" {type = object({region = stringregion_id = stringzone = stringinstance_type = string})}
variable to declare a variable. In the above declaration, cvm_type is the variable name, and var.cvm_type can be used to refer to it in the resource block.cloudapp_ and can be used by ALL installation packages.package.yaml will generate corresponding application variables. The variable name is exactly the parameter name.output "main" {value = "https://my.${var.selected_domain}"# value = "http://${tencentcloud_instance.cloudapp_cvm.public_ip}:8080"description = "access entrance"}output "a_admin_url" {value = "https://admin.${var.selected_domain}"description = "operation system"}output "b_admin_default_user" {value = "admin"description = "default admin user"}output "c_admin_default_password" {value = random_password.default_admin.resultdescription = "default administrator password"sensitive = true}
Feedback