本文向您展示如何通過模板代碼實現中文描述和參數排序。
模板樣本
ROS模板
Outputs: TiDB: Label: TiDB Value: Fn::Sub: - mysql://${ServerAddress}:4000 - ServerAddress: Fn::GetAtt: - SlbTiDB - IpAddress TiDB Dashboard: Label: en: Specifications-EN zh-cn: Specifications中文 Value: Fn::Sub: - http://${ServerAddress}:2379 - ServerAddress: Fn::GetAtt: - ControlServerEip - EipAddress Grafana: Label: en: Grafana-EN zh-cn: Grafana中文 Value: Fn::Sub: - http://${ServerAddress}:3000 - ServerAddress: Fn::GetAtt: - ControlServerEip - EipAddress ErrorData: Description: JSON serialized dict containing data associated with wait condition error signals sent to the handle. Value: Fn::GetAtt: - InvocationWaitCondition - ErrorData Metadata: ALIYUN::ROS::Interface: Outputs: - TiDB - TiDB Dashboard - Grafana - ErrorData
參數說明:
Outputs
:定義Metadata
中的Outputs
參數,實現排序功能。Label
:定義參數名稱。
Terraform模板
output "graph_private_ip" { description = <<EOT { "Label": "The private ip", "Description": "The private ip of the graph nodes." } EOT value = join("\n", module.graph-nodes.this_private_ip) }
控制台展示樣本
當您完成資源棧建立後,您可以在資源棧資訊頁簽查看中文描述和參數排序效果。