全部產品
Search
文件中心

Resource Orchestration Service:基礎資源

更新時間:Mar 17, 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]可以實現嵌套結構,且對於嵌套深度沒有限制。