全部產品
Search
文件中心

Resource Orchestration Service:RAM資源

更新時間:Mar 17, 2026

AssociationProperty取值

說明

對應的AssociationPropertyMetadata

ALIYUN::RAM::Role

RAM角色。

RegionId:地區ID(預設為資源棧所屬地區)。

樣本如下:

  • 範例程式碼

    JSON樣本:

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

    YAML樣本:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RegionId:
        Type: String
        AssociationProperty: ALIYUN::ECS::RegionId
      Role:
        Type: String
        AssociationProperty: ALIYUN::RAM::Role
        AssociationPropertyMetadata:
          RegionId: ${RegionId}
  • 樣本說明

    樣本中通過指定參數Role的AssociationProperty屬性為ALIYUN::RAM::Role,AssociationPropertyMetadata屬性為RegionId,實現擷取當前地區下的RAM角色。

ALIYUN::RAM::User

RAM使用者。

RegionId:地區ID(預設為資源棧所屬地區)。

樣本如下:

  • 範例程式碼

    JSON樣本:

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

    YAML樣本:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RegionId:
        Type: String
        AssociationProperty: ALIYUN::ECS::RegionId
      User:
        Type: String
        AssociationProperty: ALIYUN::RAM::User
        AssociationPropertyMetadata:
          RegionId: ${RegionId}
  • 樣本說明

    樣本中通過指定參數User的AssociationProperty屬性為ALIYUN::RAM::User,AssociationPropertyMetadata為RegionId,實現擷取當前地區下的RAM使用者。