全部产品
Search
文档中心

资源编排:基础资源

更新时间:Mar 16, 2026

AssociationProperty取值

说明

对应的AssociationPropertyMetadata

Auto

ROS会基于Terraform原始数据结构,自动生成AssociationProperty和AssociationPropertyMetadata等字段。

说明

仅对Terraform类型模板的JSON类型参数生效。

Overwrite:补充或覆盖内层嵌套参数的定义。

该参数可选,为字典类型,组成部分如下:

  • 内层嵌套参数的路径。路径规则如下:

    • 若要表示list或set中的元素,添加*

    • 若要表示object中的某一项,添加该项的名称。

    • 路径使用.分隔。

    • 开头和中间的*可以省略。结尾的一个或多个*不能省略。

    示例如下:

    // name的路径为name。
    // address的路径为address。
    variable "user_information" {
      type = object({
        name    = string
        address = string
      })
    }
    
    // region_ids中元素的路径为*。
    variable "region_ids" {
      type    = list(string)
    }
    
    // internal的路径为*.internal,可简写为internal。
    // external的路径为*.external,可简写为external。
    // protocol的路径为*.protocol,可简写为protocol。
    variable "docker_ports" {
      type = list(object({
        internal = number
        external = number
        protocol = string
      }))
    }
    
    // b的路径为 *.b,可简写为b。
    // b中元素的路径为*.b.*,可简写为b.*
    // c的路径为*.c,可简写为c。
    // d的路径为*.c.*.d,可简写为c.d。
    // d中元素的路径为*.c.*.d.*,可简写为c.d.*。
    // e的路径为*.e,可简写为e。
    // e中元素的路径为*.e.*,可简写为e.*。
    // e中元素的路径为*.e.*.*,可简写为e.*.*(必须保留两个*)。
    // f的路径为*.f,可简写为f。
    // g的路径为*.f.*.*.g,可简写为f.g。
    // g中元素的路径为*.f.*.*.g.*,可简写为f.g.*。
    variable "complex_type_demo" {
      type = list(object({
        b = list(string)
        c = list(object({
          d = list(string)
        }))
        e = list(list(string))
        f = list(list(object({
          g = list(string)
        })))
      }))
    }
  • 参数定义的补充。更多信息,请参见概览

AutoCompleteInput

自动生成随机字符串。

  • CharacterClasses

    • Class:字符类型。取值:

      • lowercase

      • uppercase

      • number

      • specialCharacter

    • Min:当前类型字符的最少个数。

    • SpecialCharacters:指定的特殊字符(当Class为specialCharacter时有效)。

    • Start:是否可以以特殊字符开头(当Class为specialCharacter时有效)。

    • End:是否可以以特殊字符结尾(当Class为specialCharacter时有效)。

  • Prefix:字符串前缀。

  • Suffix:字符串后缀。

  • Length:字符串长度。

示例代码

JSON示例:

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ManagedKubernetesClusterName": {
      "Type": "String",
      "Label": {
        "en": "Managed Kubernetes Cluster Name",
        "zh-cn": "ACK托管版集群名称"
      },
      "AssociationProperty": "AutoCompleteInput",
      "AssociationPropertyMetadata": {
        "Length": 5,
        "Prefix": "cluster-for-mse-",
        "Suffix": "-by-ros",
        "CharacterClasses": [
          {
            "Class": "lowercase",
            "min": 1
          }
        ]
      }
    }
  }
}

YAML示例:

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ManagedKubernetesClusterName:
    Type: String
    Label:
      en: Managed Kubernetes Cluster Name
      zh-cn: ACK托管版集群名称
    AssociationProperty: AutoCompleteInput
    AssociationPropertyMetadata:
      Length: 5
      Prefix: cluster-for-mse-
      Suffix: '-by-ros'
      CharacterClasses:
        - Class: lowercase
          min: 1

ChargeType

付费类型。取值:

  • 按量付费。

  • 包年包月。

Code

代码输入。

CommaDelimitedList

输入用逗号分隔的数组。

Cron

Cron表达式,指定定时任务执行时间的格式化字符串。

DateTime

日期。

  • GMTZone:GMT可用区。

  • TimeZone:时区描述。

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DateTime": {
          "Type": "String",
          "AssociationProperty": "DateTime"
        }
      }
    }

    YAML示例:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DateTime:
        Type: String
        AssociationProperty: DateTime
  • 示例说明

    示例中通过指定参数DateTime的AssociationProperty为DateTime,来设置日期。

FileContent

从本地文件读取内容。

AcceptFileSuffixes:接受上传的文件类型。多个文件类型之间用半角逗号分隔开。

GMTZone

GMT可用区选择。

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "GMTZone": {
          "Type": "String",
          "AssociationProperty": "GMTZone"
        }
      }
    }

    YAML示例:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      GMTZone:
        Type: String
        AssociationProperty: GMTZone
  • 示例说明

    示例中通过指定参数GMTZone的AssociationProperty属性为GMTZone,设置GMT可用区。

Json

JSON对象输入。

List[Parameter]

参数列表。使用缩进排布。

仅对Json类型参数生效。

  • Parameter:参数定义。

  • Mode:展示样式

    • Collapse:折叠样式。(默认值)

    • Table:表格样式。

更多信息,请参见概览

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "RegionIds": {
          "Label": {
            "en": "ECS Region Ids",
            "zh-cn": "ECS地域列表"
          },
          "MaxLength": 100,
          "MinLength": 1,
          "Type": "Json",
          "AssociationProperty": "List[Parameter]",
          "AssociationPropertyMetadata": {
            "Parameter": {
              "Type": "String",
              "AssociationProperty": "ALIYUN::ECS::RegionId",
              "MinLength": 1,
              "MaxLength": 64
            }
          }
        }
      }
    }

    YAML示例:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RegionIds:
        Label:
          en: ECS Region Ids
          zh-cn: ECS地域列表
        MaxLength: 100
        MinLength: 1
        Type: Json
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            Type: String
            AssociationProperty: ALIYUN::ECS::RegionId
            MinLength: 1
            MaxLength: 64
  • 示例说明

    示例中通过指定AssociationProperty为List[Parameter],AssociationPropertyMetadata为Parameter,实现多个ECS地域ID在控制台缩进排布的效果。

List[Parameters]

参数组列表。使用表格排布。

仅对Json类型参数生效。

  • Parameters:字典类型,必选,表示一组参数定义。

    • 键:参数名。

    • 值:参数定义。更多信息,请参见概览

      说明

      由于使用表格排布,建议使用简单类型参数,不建议进行嵌套。

    示例如下:

    • 示例代码

      JSON示例:

      {
        "ROSTemplateFormatVersion": "2015-09-01",
        "Parameters": {
          "RenameECS": {
            "Label": {
              "en": "Rename ECS",
              "zh-cn": "重命名ECS"
            },
            "MaxLength": 100,
            "MinLength": 1,
            "Type": "Json",
            "AssociationProperty": "List[Parameters]",
            "AssociationPropertyMetadata": {
              "Parameters": {
                "InstanceId": {
                  "Type": "String",
                  "Label": {
                    "en": "ECS Instance Id",
                    "zh-cn": "ECS实例ID"
                  },
                  "AssociationProperty": "ALIYUN::ECS::Instance::InstanceId",
                  "MinLength": 1,
                  "MaxLength": 64
                },
                "Name": {
                  "Type": "String",
                  "Label": {
                    "en": "New Name",
                    "zh-cn": "新名称"
                  },
                  "MinLength": 1
                }
              }
            }
          }
        }
      }

      YAML示例:

      ROSTemplateFormatVersion: '2015-09-01'
      Parameters:
        RenameECS:
          Label:
            en: Rename ECS
            zh-cn: 重命名ECS
          MaxLength: 100
          MinLength: 1
          Type: Json
          AssociationProperty: List[Parameters]
          AssociationPropertyMetadata:
            Parameters:
              InstanceId:
                Type: String
                Label:
                  en: ECS Instance Id
                  zh-cn: ECS实例ID
                AssociationProperty: ALIYUN::ECS::Instance::InstanceId
                MinLength: 1
                MaxLength: 64
              Name:
                Type: String
                Label:
                  en: New Name
                  zh-cn: 新名称
                MinLength: 1
    • 示例说明

      示例中通过指定AssociationProperty为List[Parameters],AssociationPropertyMetadata为Parameters,实现多个ECS实例ID在控制台表格排布的效果。

  • ListMetadata:字典类型,用于控制表格显示。

    • ShowHeader:枚举类型,表示是否显示表头。默认值:true。

    • ShowRemove:枚举类型,表示是否显示移除按钮。默认值:true。

    • ShowAddition:枚举类型,表示是否新增按钮。默认值:true。

    • Order:字符串列表,表示表格从左到右每列对应的参数。默认所有参数按字母序排列显示。

OOSServiceRole

OOS的服务角色。

RegionId:地域ID(默认为资源栈所属地域)。

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "RegionId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::RegionId"
        },
        "OosServiceRole": {
          "Type": "String",
          "AssociationProperty": "OOSServiceRole",
          "AssociationPropertyMetadata": {
            "RegionId": "${RegionId}"
          }
        }
      }
    }

    YAML示例;

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RegionId:
        Type: String
        AssociationProperty: ALIYUN::ECS::RegionId
      OosServiceRole:
        Type: String
        AssociationProperty: OOSServiceRole
        AssociationPropertyMetadata:
          RegionId: ${RegionId}
  • 示例说明

    示例中通过指定参数OosServiceRole的AssociationProperty属性为OOSServiceRole,设置OOS的服务角色。

Password

密码输入。

RateControl

OOS的执行速率。

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "RateControl": {
          "Type": "String",
          "AssociationProperty": "RateControl"
        }
      }
    }

    YAML示例:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RateControl:
        Type: String
        AssociationProperty: RateControl
  • 示例说明

    示例中通过指定参数RateControl的AssociationProperty属性为RateControl,配置OOS执行速率。

Tags

标签。

  • RegionId:地域ID(默认为资源栈所属地域)。

  • ResourceType:用于分组统计的资源类型。默认值:ALIYUN::ECS::INSTANCE。

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "RegionId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::RegionId"
        },
        "Tags": {
          "Type": "String",
          "AssociationProperty": "Tags",
          "AssociationPropertyMetadata": {
            "RegionId": "${RegionId}",
            "ResourceType": "ALIYUN::ECS::INSTANCE"
          }
        }
      }
    }

    YAML示例:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RegionId:
        Type: String
        AssociationProperty: ALIYUN::ECS::RegionId
      Tags:
        Type: String
        AssociationProperty: Tags
        AssociationPropertyMetadata:
          RegionId: ${RegionId}
          ResourceType: ALIYUN::ECS::INSTANCE
  • 示例说明

    示例中通过指定参数Tags的AssociationProperty属性为Tags,AssociationPropertyMetadata属性为RegionId、ResourceType,获取ECS实例的自定义标签信息。

Targets

ECS实例对象。支持通过实例ID、标签、资源组等方式选择实例。

RegionId:地域ID(默认为资源栈所属地域)。

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "RegionId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::RegionId"
        },
        "Targets": {
          "Type": "String",
          "AssociationProperty": "Targets",
          "AssociationPropertyMetadata": {
            "RegionId": "${RegionId}"
          }
        }
      }
    }

    YAML示例:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RegionId:
        Type: String
        AssociationProperty: ALIYUN::ECS::RegionId
      Targets:
        Type: String
        AssociationProperty: Targets
        AssociationPropertyMetadata:
          RegionId: ${RegionId}
  • 示例说明

    示例中通过指定参数Targets的AssociationProperty属性为Targets,AssociationPropertyMetadata属性为RegionId,获取ECS实例对象。

TextArea

富文本输入。

TimeTriggerWeekly

按周选择时间。

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "TimeTriggerWeekly": {
          "Type": "String",
          "AssociationProperty": "TimeTriggerWeekly"
        }
      }
    }

    YAML示例:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      TimeTriggerWeekly:
        Type: String
        AssociationProperty: TimeTriggerWeekly
  • 示例说明

    示例中通过指定参数TimeTriggerWeekly的AssociationProperty属性为TimeTriggerWeekly,实现按周选择时间。

TimeZone

时区选择。

示例如下:

  • 示例代码

    JSON示例:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "TimeZone": {
          "Type": "String",
          "AssociationProperty": "TimeZone"
        }
      }
    }

    YAML示例:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      TimeZone:
        Type: String
        AssociationProperty: TimeZone
  • 示例说明

    示例中通过指定参数TimeZone的AssociationProperty属性为TimeZone,来配置时区。

使用缩进排布。

仅对Json类型参数生效。

说明

不指定AssociationProperty,仅指定AssociationPropertyMetadata,为参数实现缩进排布。

  • Parameters:字典类型,表示一组参数定义。

    • 键:参数名。

    • 值:参数定义。更多信息,请参见概览

    示例如下:

    • 示例代码

      JSON示例:

      {
        "ROSTemplateFormatVersion": "2015-09-01",
        "Parameters": {
          "RenameECS": {
            "Label": {
              "en": "Rename ECS",
              "zh-cn": "重命名ECS"
            },
            "MaxLength": 100,
            "MinLength": 1,
            "Type": "Json",
            "AssociationPropertyMetadata": {
              "Parameters": {
                "InstanceId": {
                  "Type": "String",
                  "Label": {
                    "en": "ECS Instance Id",
                    "zh-cn": "ECS实例ID"
                  },
                  "AssociationProperty": "ALIYUN::ECS::Instance::InstanceId",
                  "MinLength": 1,
                  "MaxLength": 64
                },
                "Name": {
                  "Type": "String",
                  "Label": {
                    "en": "New Name",
                    "zh-cn": "新名称"
                  },
                  "MinLength": 1
                }
              }
            }
          }
        }
      }

      YAML示例:

      ROSTemplateFormatVersion: '2015-09-01'
      Parameters:
        RenameECS:
          Label:
            en: Rename ECS
            zh-cn: 重命名ECS
          MaxLength: 100
          MinLength: 1
          Type: Json
          AssociationPropertyMetadata:
            Parameters:
              InstanceId:
                Type: String
                Label:
                  en: ECS Instance Id
                  zh-cn: ECS实例ID
                AssociationProperty: ALIYUN::ECS::Instance::InstanceId
                MinLength: 1
                MaxLength: 64
              Name:
                Type: String
                Label:
                  en: New Name
                  zh-cn: 新名称
                MinLength: 1
    • 示例说明

      示例中不指定AssociationProperty,仅指定AssociationPropertyMetadata为Parameters,实现单个ECS实例ID在控制台缩进排布的效果。

  • Metadata:字典类型。更多信息,请参见元数据(Metadata)

说明

结合List[Parameter]可以实现嵌套结构,且对于嵌套深度没有限制。