Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::OOS::StateConfiguration

Última atualização: Jun 27, 2026

O recurso ALIYUN::OOS::StateConfiguration cria uma configuração de estado desejado.

Sintaxe

{
  "Type": "ALIYUN::OOS::StateConfiguration",
  "Properties": {
    "ConfigureMode": String,
    "ScheduleExpression": String,
    "ScheduleType": String,
    "Description": String,
    "Parameters": String,
    "ResourceGroupId": String,
    "TemplateName": String,
    "TemplateVersion": String,
    "Targets": String,
    "Tags": Map
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

ConfigureMode

String

Não

Sim

Modo de configuração.

Valores válidos:

  • ApplyOnce: aplica a configuração apenas uma vez. A nova configuração entra em vigor após atualizações.

  • ApplyAndMonitor: aplica a configuração uma vez e monitora desvios subsequentes.

  • ApplyAndAutoCorrect: aplica a configuração continuamente.

ScheduleExpression

String

Sim

Sim

Expressão de agendamento.

Intervalo mínimo entre agendamentos: 30 minutos.

ScheduleType

String

Sim

Sim

Tipo de agendamento.

Defina como rate.

Description

String

Não

Sim

Descrição da configuração de estado desejado.

Nenhuma.

Parameters

String

Não

Sim

Parâmetros de configuração.

Exemplo:

{ "policy": { "ACS:Application": { "Collection": "Enabled" }, "ACS:Network": { "Collection": "Enabled" } } }

ResourceGroupId

String

Não

Sim

ID do grupo de recursos.

Nenhuma.

TemplateName

String

Sim

Não

Nome do modelo.

Máximo de 200 caracteres. Permite letras, dígitos, hifens (-) e sublinhados (_).

TemplateVersion

String

Não

Não

Versão do modelo.

Padrão: versão mais recente.

Targets

String

Sim

Sim

Recursos de destino para consulta.

Nenhuma.

Tags

Map

Não

Sim

Tags do recurso.

Limite de 20 chaves. Exemplo:

{"Key": "oos", "Value": "inventory"}

Valores de retorno

Fn::GetAtt

StateConfigurationId: ID da configuração de estado desejado.

Exemplos

  • YAML formato

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ConfigureMode:
        Description:
          en: 'The configuration mode. Valid values: ApplyOnce: The configuration is applied
            only once. After a configuration is updated, the new configuration is applied.
            ApplyAndMonitor: The configuration is applied only once. After the configuration
            is applied, the system only checks whether the configuration is migrated in
            the future. ApplyAndAutoCorrect: The configuration is always applied.'
        Required: false
        Type: String
      Description:
        AssociationProperty: TextArea
        Description:
          en: The description of the desired-state configuration.
        Required: false
        Type: String
      Parameters:
        Description:
          en: The parameters.
        Required: false
        Type: String
      ResourceGroupId:
        AssociationProperty: ALIYUN::ECS::ResourceGroup::ResourceGroupId
        Description:
          en: The resource group ID.
        Required: false
        Type: String
      ScheduleExpression:
        Description:
          en: The schedule expression. The interval between two schedules must be a minimum
            of 30 minutes.
        Required: true
        Type: String
      ScheduleType:
        Description:
          en: The schedule type. Set the value to rate.
        Required: true
        Type: String
      Tags:
        Description:
          en: Tag value and the key mapping, the label of the key number can be up to
            20.
        Required: false
        Type: Json
      Targets:
        Description:
          en: The resources to be queried.
        Required: true
        Type: String
      TemplateName:
        Description:
          en: The name of the template. The name must be 1 to 200 characters in length
            and can contain letters, digits, hyphens (-), and underscores (_).
        Required: true
        Type: String
      TemplateVersion:
        Description:
          en: The version number of the template. If you do not specify this parameter,
            the latest version of the template is used.
        Required: false
        Type: String
    Resources:
      StateConfiguration:
        Properties:
          ConfigureMode:
            Ref: ConfigureMode
          Description:
            Ref: Description
          Parameters:
            Ref: Parameters
          ResourceGroupId:
            Ref: ResourceGroupId
          ScheduleExpression:
            Ref: ScheduleExpression
          ScheduleType:
            Ref: ScheduleType
          Tags:
            Ref: Tags
          Targets:
            Ref: Targets
          TemplateName:
            Ref: TemplateName
          TemplateVersion:
            Ref: TemplateVersion
        Type: ALIYUN::OOS::StateConfiguration
    Outputs:
      StateConfigurationId:
        Description: The ID of the desired-state configuration.
        Value:
          Fn::GetAtt:
          - StateConfiguration
          - StateConfigurationId
                            
  • JSON formato

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ConfigureMode": {
          "Type": "String",
          "Description": {
            "en": "The configuration mode. Valid values: ApplyOnce: The configuration is applied only once. After a configuration is updated, the new configuration is applied. ApplyAndMonitor: The configuration is applied only once. After the configuration is applied, the system only checks whether the configuration is migrated in the future. ApplyAndAutoCorrect: The configuration is always applied."
          },
          "Required": false
        },
        "ScheduleExpression": {
          "Type": "String",
          "Description": {
            "en": "The schedule expression. The interval between two schedules must be a minimum of 30 minutes."
          },
          "Required": true
        },
        "ScheduleType": {
          "Type": "String",
          "Description": {
            "en": "The schedule type. Set the value to rate."
          },
          "Required": true
        },
        "Description": {
          "AssociationProperty": "TextArea",
          "Type": "String",
          "Description": {
            "en": "The description of the desired-state configuration."
          },
          "Required": false
        },
        "Parameters": {
          "Type": "String",
          "Description": {
            "en": "The parameters."
          },
          "Required": false
        },
        "ResourceGroupId": {
          "AssociationProperty": "ALIYUN::ECS::ResourceGroup::ResourceGroupId",
          "Type": "String",
          "Description": {
            "en": "The resource group ID."
          },
          "Required": false
        },
        "TemplateName": {
          "Type": "String",
          "Description": {
            "en": "The name of the template. The name must be 1 to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_)."
          },
          "Required": true
        },
        "TemplateVersion": {
          "Type": "String",
          "Description": {
            "en": "The version number of the template. If you do not specify this parameter, the latest version of the template is used."
          },
          "Required": false
        },
        "Targets": {
          "Type": "String",
          "Description": {
            "en": "The resources to be queried."
          },
          "Required": true
        },
        "Tags": {
          "Type": "Json",
          "Description": {
            "en": "Tag value and the key mapping, the label of the key number can be up to 20."
          },
          "Required": false
        }
      },
      "Resources": {
        "StateConfiguration": {
          "Type": "ALIYUN::OOS::StateConfiguration",
          "Properties": {
            "ConfigureMode": {
              "Ref": "ConfigureMode"
            },
            "ScheduleExpression": {
              "Ref": "ScheduleExpression"
            },
            "ScheduleType": {
              "Ref": "ScheduleType"
            },
            "Description": {
              "Ref": "Description"
            },
            "Parameters": {
              "Ref": "Parameters"
            },
            "ResourceGroupId": {
              "Ref": "ResourceGroupId"
            },
            "TemplateName": {
              "Ref": "TemplateName"
            },
            "TemplateVersion": {
              "Ref": "TemplateVersion"
            },
            "Targets": {
              "Ref": "Targets"
            },
            "Tags": {
              "Ref": "Tags"
            }
          }
        }
      },
      "Outputs": {
        "StateConfigurationId": {
          "Description": "The ID of the desired-state configuration.",
          "Value": {
            "Fn::GetAtt": [
              "StateConfiguration",
              "StateConfigurationId"
            ]
          }
        }
      }
    }