Todos os produtos
Search
Central de documentação

Resource Orchestration Service:DATASOURCE::OOS::Parameter

Última atualização: Jul 20, 2026

O tipo de fonte de dados DATASOURCE::OOS::Parameter consulta parâmetros comuns.

Sintaxe

{
  "Type": "DATASOURCE::OOS::Parameter",
  "Properties": {
    "Name": String,
    "ParameterVersion": Integer,
    "RefreshOptions": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrições

Name

String

Sim

Não

Nome do parâmetro comum.

Nenhuma

ParameterVersion

Integer

Não

Não

Número da versão do parâmetro comum.

Nenhuma

RefreshOptions

String

Não

Sim

Política de atualização do recurso de fonte de dados durante a atualização da pilha.

Valores válidos:

  • Never (padrão): o recurso de fonte de dados nunca é atualizado durante a atualização da pilha.

  • Always: o recurso de fonte de dados é sempre atualizado durante a atualização da pilha.

Valores de retorno

Fn::GetAtt

  • UpdatedBy: usuário que atualizou o parâmetro comum pela última vez.

  • Type: tipo de dados do parâmetro comum.

  • Description: descrição do parâmetro comum.

  • Constraints: restrições do parâmetro comum.

  • CreatedBy: usuário que criou o parâmetro comum.

  • UpdatedDate: data e hora da última atualização do parâmetro comum.

  • ParameterVersion: número da versão do parâmetro comum.

  • Value: valor do parâmetro comum.

  • CreatedDate: data e hora de criação do parâmetro comum.

  • ParameterId: ID do parâmetro comum.

  • Tags: tags do parâmetro comum.

  • ShareType: tipo de compartilhamento do parâmetro comum.

Exemplos

Cenário 1: Consultar o valor e os metadados de um único parâmetro comum do OOS

ROSTemplateFormatVersion: '2015-09-01'
Description:
  en: Query the value and metadata of an existing OOS common parameter for referencing centralized configurations in a stack.
Parameters:
  ParameterName:
    Type: String
    Label: Common Parameter Name
    Description: The name of the OOS common parameter. The name cannot start with ALIYUN, ALIBABA, ALICLOUD, ACS, or OOS.
    Default: demo-config-param
Resources:
  ParameterDataSource:
    Type: DATASOURCE::OOS::Parameter
    Properties:
      Name:
        Ref: ParameterName
Outputs:
  ParameterId:
    Description: Common parameter ID.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - ParameterId
  ParameterValue:
    Description: Common parameter value.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - Value
  ParameterType:
    Description: Common parameter data type.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - Type
  ParameterVersion:
    Description: Common parameter version number.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - ParameterVersion
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "en": "Query the value and metadata of an existing OOS common parameter for referencing centralized configurations in a stack."
  },
  "Parameters": {
    "ParameterName": {
      "Type": "String",
      "Label": "Common Parameter Name",
      "Description": "The name of the OOS common parameter. The name cannot start with ALIYUN, ALIBABA, ALICLOUD, ACS, or OOS.",
      "Default": "demo-config-param"
    }
  },
  "Resources": {
    "ParameterDataSource": {
      "Type": "DATASOURCE::OOS::Parameter",
      "Properties": {
        "Name": { "Ref": "ParameterName" }
      }
    }
  },
  "Outputs": {
    "ParameterId": {
      "Description": "Common parameter ID.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "ParameterId"] }
    },
    "ParameterValue": {
      "Description": "Common parameter value.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "Value"] }
    },
    "ParameterType": {
      "Description": "Common parameter data type.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "Type"] }
    },
    "ParameterVersion": {
      "Description": "Common parameter version number.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "ParameterVersion"] }
    }
  }
}

Cenário 2: Consultar uma versão específica de um parâmetro comum do OOS com política de atualização configurada

ROSTemplateFormatVersion: '2015-09-01'
Description:
  en: Query a specific version of an OOS common parameter and configure the refresh policy on stack update.
Parameters:
  ParameterName:
    Type: String
    Label: Common Parameter Name
    Description: The name of the OOS common parameter. The name cannot start with ALIYUN, ALIBABA, ALICLOUD, ACS, or OOS.
    Default: demo-config-param
  ParameterVersion:
    Type: Number
    Label: Parameter Version Number
    Description: The version number of the parameter to query. Leave empty to query the latest version.
    MinValue: 1
    Default: 1
  RefreshOptions:
    Type: String
    Label: Refresh Policy
    Description: The refresh policy of the data source resource when the stack is updated. Always: Refresh on every update. Never: Never refresh.
    AllowedValues:
      - Always
      - Never
    Default: Always
Resources:
  ParameterDataSource:
    Type: DATASOURCE::OOS::Parameter
    Properties:
      Name:
        Ref: ParameterName
      ParameterVersion:
        Ref: ParameterVersion
      RefreshOptions:
        Ref: RefreshOptions
Outputs:
  ParameterId:
    Description: Common parameter ID.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - ParameterId
  ParameterValue:
    Description: Common parameter value for the specified version.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - Value
  ParameterType:
    Description: Common parameter data type.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - Type
  ParameterVersion:
    Description: Version number of the queried parameter.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - ParameterVersion
  ParameterDescription:
    Description: Common parameter description.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - Description
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "en": "Query a specific version of an OOS common parameter and configure the refresh policy on stack update."
  },
  "Parameters": {
    "ParameterName": {
      "Type": "String",
      "Label": "Common Parameter Name",
      "Description": "The name of the OOS common parameter. The name cannot start with ALIYUN, ALIBABA, ALICLOUD, ACS, or OOS.",
      "Default": "demo-config-param"
    },
    "ParameterVersion": {
      "Type": "Number",
      "Label": "Parameter Version Number",
      "Description": "The version number of the parameter to query. Leave empty to query the latest version.",
      "MinValue": 1,
      "Default": 1
    },
    "RefreshOptions": {
      "Type": "String",
      "Label": "Refresh Policy",
      "Description": "The refresh policy of the data source resource when the stack is updated. Always: Refresh on every update. Never: Never refresh.",
      "AllowedValues": ["Always", "Never"],
      "Default": "Always"
    }
  },
  "Resources": {
    "ParameterDataSource": {
      "Type": "DATASOURCE::OOS::Parameter",
      "Properties": {
        "Name": { "Ref": "ParameterName" },
        "ParameterVersion": { "Ref": "ParameterVersion" },
        "RefreshOptions": { "Ref": "RefreshOptions" }
      }
    }
  },
  "Outputs": {
    "ParameterId": {
      "Description": "Common parameter ID.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "ParameterId"] }
    },
    "ParameterValue": {
      "Description": "Common parameter value for the specified version.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "Value"] }
    },
    "ParameterType": {
      "Description": "Common parameter data type.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "Type"] }
    },
    "ParameterVersion": {
      "Description": "Version number of the queried parameter.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "ParameterVersion"] }
    },
    "ParameterDescription": {
      "Description": "Common parameter description.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "Description"] }
    }
  }
}

Cenário 3: Crie um parâmetro comum do OOS para armazenar um tipo de instância ECS e usar a fonte de dados para orientar a criação da instância ECS

ROSTemplateFormatVersion: '2015-09-01'
Description:
  en: Create an OOS common parameter to store an ECS instance type, query it via a data source, and use the value to create an ECS instance, achieving centralized configuration-driven resource creation.
Parameters:
  ZoneId:
    Type: String
    Label: Availability Zone
    Description: The availability zone for the ECS instance and vSwitch.
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
  ImageId:
    Type: String
    Label: Image ID
    Description: The image ID for the ECS instance. You can select from the image dropdown.
    AssociationProperty: ALIYUN::ECS::ImageId::ImageID
  SystemDiskCategory:
    Type: String
    Label: System Disk Category
    Description: The disk category for the ECS system disk.
    Default: cloud_essd
  InstancePassword:
    Type: String
    Label: Instance Password
    Description: 8~30 characters, containing at least three of the following: uppercase letters, lowercase letters, digits, and special characters.
    NoEcho: true
    MinLength: 8
    MaxLength: 30
  ParameterName:
    Type: String
    Label: OOS Parameter Name
    Description: The name of the OOS common parameter used to store the instance type. The name cannot start with ALIYUN, ALIBABA, ALICLOUD, ACS, or OOS.
    Default: demo-ecs-instance-type
  ParameterValue:
    Type: String
    Label: Parameter Value (Instance Type)
    Description: The ECS instance type to store in the OOS common parameter, for example, ecs.t6-c1m2.large.
    MinLength: 1
    MaxLength: 4096
    Default: ecs.t6-c1m2.large
Resources:
  OosParameter:
    Type: ALIYUN::OOS::Parameter
    Properties:
      Name:
        Ref: ParameterName
      Type: String
      Value:
        Ref: ParameterValue
      Description: ECS instance type managed by OOS Parameter Store
  ParameterDataSource:
    Type: DATASOURCE::OOS::Parameter
    Properties:
      Name:
        Fn::GetAtt:
          - OosParameter
          - Name
      RefreshOptions: Always
    DependsOn: OosParameter
  Vpc:
    Type: ALIYUN::ECS::VPC
    Properties:
      CidrBlock: 192.168.0.0/16
      VpcName: oos-demo-vpc
  VSwitch:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      ZoneId:
        Ref: ZoneId
      CidrBlock: 192.168.0.0/24
      VpcId:
        Ref: Vpc
      VSwitchName: oos-demo-vsw
  SecurityGroup:
    Type: ALIYUN::ECS::SecurityGroup
    Properties:
      VpcId:
        Ref: Vpc
      SecurityGroupName: oos-demo-sg
  EcsInstance:
    Type: ALIYUN::ECS::InstanceGroup
    Properties:
      ZoneId:
        Ref: ZoneId
      InstanceType:
        Fn::GetAtt:
          - ParameterDataSource
          - Value
      ImageId:
        Ref: ImageId
      SystemDiskCategory:
        Ref: SystemDiskCategory
      VpcId:
        Ref: Vpc
      VSwitchId:
        Ref: VSwitch
      SecurityGroupId:
        Ref: SecurityGroup
      Password:
        Ref: InstancePassword
      InstanceName: oos-demo-ecs
      MaxAmount: 1
      InternetMaxBandwidthOut: 5
    DependsOn:
      - ParameterDataSource
      - VSwitch
      - SecurityGroup
Outputs:
  ParameterId:
    Description: OOS common parameter ID.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - ParameterId
  ParameterName:
    Description: OOS common parameter name.
    Value:
      Ref: ParameterName
  ParameterValue:
    Description: The parameter value (ECS instance type) retrieved by the data source.
    Value:
      Fn::GetAtt:
        - ParameterDataSource
        - Value
  InstanceIds:
    Description: The list of ECS instance IDs created.
    Value:
      Fn::GetAtt:
        - EcsInstance
        - InstanceIds
  PublicIps:
    Description: The list of public IP addresses of the ECS instances.
    Value:
      Fn::GetAtt:
        - EcsInstance
        - PublicIps
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "en": "Create an OOS common parameter to store an ECS instance type, query it via a data source, and use the value to create an ECS instance, achieving centralized configuration-driven resource creation."
  },
  "Parameters": {
    "ZoneId": {
      "Type": "String",
      "Label": "Availability Zone",
      "Description": "The availability zone for the ECS instance and vSwitch.",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
    },
    "ImageId": {
      "Type": "String",
      "Label": "Image ID",
      "Description": "The image ID for the ECS instance. You can select from the image dropdown.",
      "AssociationProperty": "ALIYUN::ECS::ImageId::ImageID"
    },
    "SystemDiskCategory": {
      "Type": "String",
      "Label": "System Disk Category",
      "Description": "The disk category for the ECS system disk.",
      "Default": "cloud_essd"
    },
    "InstancePassword": {
      "Type": "String",
      "Label": "Instance Password",
      "Description": "8~30 characters, containing at least three of the following: uppercase letters, lowercase letters, digits, and special characters.",
      "NoEcho": true,
      "MinLength": 8,
      "MaxLength": 30
    },
    "ParameterName": {
      "Type": "String",
      "Label": "OOS Parameter Name",
      "Description": "The name of the OOS common parameter used to store the instance type. The name cannot start with ALIYUN, ALIBABA, ALICLOUD, ACS, or OOS.",
      "Default": "demo-ecs-instance-type"
    },
    "ParameterValue": {
      "Type": "String",
      "Label": "Parameter Value (Instance Type)",
      "Description": "The ECS instance type to store in the OOS common parameter, for example, ecs.t6-c1m2.large.",
      "MinLength": 1,
      "MaxLength": 4096,
      "Default": "ecs.t6-c1m2.large"
    }
  },
  "Resources": {
    "OosParameter": {
      "Type": "ALIYUN::OOS::Parameter",
      "Properties": {
        "Name": { "Ref": "ParameterName" },
        "Type": "String",
        "Value": { "Ref": "ParameterValue" },
        "Description": "ECS instance type managed by OOS Parameter Store"
      }
    },
    "ParameterDataSource": {
      "Type": "DATASOURCE::OOS::Parameter",
      "Properties": {
        "Name": { "Fn::GetAtt": ["OosParameter", "Name"] },
        "RefreshOptions": "Always"
      },
      "DependsOn": "OosParameter"
    },
    "Vpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": { "CidrBlock": "192.168.0.0/16", "VpcName": "oos-demo-vpc" }
    },
    "VSwitch": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "ZoneId": { "Ref": "ZoneId" },
        "CidrBlock": "192.168.0.0/24",
        "VpcId": { "Ref": "Vpc" },
        "VSwitchName": "oos-demo-vsw"
      }
    },
    "SecurityGroup": {
      "Type": "ALIYUN::ECS::SecurityGroup",
      "Properties": { "VpcId": { "Ref": "Vpc" }, "SecurityGroupName": "oos-demo-sg" }
    },
    "EcsInstance": {
      "Type": "ALIYUN::ECS::InstanceGroup",
      "Properties": {
        "ZoneId": { "Ref": "ZoneId" },
        "InstanceType": { "Fn::GetAtt": ["ParameterDataSource", "Value"] },
        "ImageId": { "Ref": "ImageId" },
        "SystemDiskCategory": { "Ref": "SystemDiskCategory" },
        "VpcId": { "Ref": "Vpc" },
        "VSwitchId": { "Ref": "VSwitch" },
        "SecurityGroupId": { "Ref": "SecurityGroup" },
        "Password": { "Ref": "InstancePassword" },
        "InstanceName": "oos-demo-ecs",
        "MaxAmount": 1,
        "InternetMaxBandwidthOut": 5
      },
      "DependsOn": ["ParameterDataSource", "VSwitch", "SecurityGroup"]
    }
  },
  "Outputs": {
    "ParameterId": {
      "Description": "OOS common parameter ID.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "ParameterId"] }
    },
    "ParameterName": {
      "Description": "OOS common parameter name.",
      "Value": { "Ref": "ParameterName" }
    },
    "ParameterValue": {
      "Description": "The parameter value (ECS instance type) retrieved by the data source.",
      "Value": { "Fn::GetAtt": ["ParameterDataSource", "Value"] }
    },
    "InstanceIds": {
      "Description": "The list of ECS instance IDs created.",
      "Value": { "Fn::GetAtt": ["EcsInstance", "InstanceIds"] }
    },
    "PublicIps": {
      "Description": "The list of public IP addresses of the ECS instances.",
      "Value": { "Fn::GetAtt": ["EcsInstance", "PublicIps"] }
    }
  }
}