Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ECS::ElasticityAssurance

Última atualização: Jun 27, 2026

O recurso ALIYUN::ECS::ElasticityAssurance cria uma garantia de elasticidade.

Sintaxe

{
  "Type": "ALIYUN::ECS::ElasticityAssurance",
  "Properties": {
    "Description": String,
    "InstanceAmount": Integer,
    "PrivatePoolOptions": Map,
    "ZoneId": String,
    "ResourceGroupId": String,
    "StartTime": String,
    "Period": Integer,
    "InstanceTypes": List,
    "RecurrenceRules": List,
    "AutoRenewPeriod": Integer,
    "AutoRenew": Boolean,
    "InstanceCpuCoreCount": Integer,
    "Tags": List,
    "PeriodUnit": String
  }
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

InstanceAmount

Integer

Sim

Não

Número total de instâncias para reserva de capacidade de um tipo de instância.

Valores válidos: 1 a 1000.

ZoneId

String

Sim

Não

ID da zona da garantia de elasticidade.

A garantia de elasticidade permite reservar recursos em apenas uma zona.

AutoRenew

Boolean

Não

Não

Define se a renovação automática está ativada.

Valores válidos:

  • true

  • false

Valor padrão: false.

AutoRenewPeriod

Integer

Não

Não

Período de renovação automática.

Unidade: mês. Valores válidos: 1, 2, 3, 6, 12, 24 e 36.

  • O valor padrão desta propriedade é 1 quando PeriodUnit is set to Month.

  • O valor padrão desta propriedade é 12 quando PeriodUnit is set to Year.

Nota

Especifique AutoRenewPeriod quando AutoRenew estiver definido como True.

Description

String

Não

Sim

Descrição da garantia de elasticidade.

A descrição deve ter de 2 a 256 caracteres. Pode conter letras, mas não pode começar com http:// ou https://.

PeriodUnit

String

Não

Não

Unidade de duração da assinatura.

Valores válidos:

  • Month

  • Year (padrão)

PrivatePoolOptions

Map

Não

Sim

Configurações da garantia de elasticidade.

Para mais informações, consulte Propriedades de PrivatePoolOptions.

Period

Integer

Não

Não

Duração da assinatura.

A unidade de duração da assinatura é determinada pelo valor de PeriodUnit.

  • Valores válidos para Period quando PeriodUnit está definido como Month: 1 a 9.

  • Valores válidos para Period quando PeriodUnit está definido como Year: 1 a 5.

ResourceGroupId

String

Não

Não

ID do grupo de recursos ao qual atribuir a garantia de elasticidade.

Nenhuma.

RecurrenceRules

List

Não

Não

Agendamentos da garantia de elasticidade segmentada por tempo.

Nenhuma.

StartTime

String

Não

Não

Momento em que a garantia de elasticidade entra em vigor.

O valor padrão corresponde ao horário de criação da garantia via ALIYUN::ECS::ElasticityAssurance. Especifique o horário no padrão ISO 8601, no formato yyyy-MM-ddTHH:mm:ssZ. O horário deve estar em UTC+0. Para mais detalhes, consulte Formato de hora.

InstanceCpuCoreCount

Integer

Não

Não

Número total de vCPUs da instância suportadas durante a vigência da garantia de elasticidade.

Nenhuma.

InstanceTypes

List

Sim

Não

Tipos de instância.

A garantia de elasticidade permite reservar capacidade para apenas um tipo de instância.

Tags

List

Não

Não

Tags a adicionar à garantia de elasticidade.

É possível adicionar até 20 tags. Para mais informações, consulte Propriedades de Tags.

Sintaxe de PrivatePoolOptions

"PrivatePoolOptions": {
  "MatchCriteria": String,
  "Name": String
}

Propriedades de PrivatePoolOptions

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

MatchCriteria

String

Não

Não

Tipo de pool privado ao qual associar a garantia de elasticidade.

Valores válidos:

  • Open: pool privado aberto

  • Target: pool privado especificado

Name

String

Não

Sim

Nome da garantia de elasticidade.

O nome deve ter de 2 a 128 caracteres. Deve começar com uma letra e não pode iniciar com http:// ou https://. São permitidos letras, dígitos, dois-pontos (:), sublinhados (_) e hífens (-).

Sintaxe de RecurrenceRules

"RecurrenceRules": [
  {
    "RecurrenceType": String,
    "StartHour": Integer,
    "EndHour": Integer,
    "RecurrenceValue": String
  }
]

Propriedades de RecurrenceRules

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

EndHour

Integer

Não

Não

Horário de término do período de garantia para a reserva de capacidade da garantia de elasticidade segmentada por tempo.

Especifique uma hora cheia.

RecurrenceType

String

Não

Não

Tipo de agendamento da garantia.

Valores válidos:

  • Daily

  • Weekly

  • Monthly

Nota

Especifique RecurrenceType e RecurrenceValue.

RecurrenceValue

String

Não

Não

Dias da semana ou do mês em que a reserva de capacidade da garantia de elasticidade segmentada por tempo entra em vigor, ou o intervalo (em dias) para essa ativação.

  • Se RecurrenceType for Daily, especifique apenas um valor. Valores válidos: 1 a 31. O valor indica que a reserva de capacidade entra em vigor a cada X dias.

  • Se RecurrenceType for Weekly, especifique vários valores separados por vírgula (,). Valores válidos: 0, 1, 2, 3, 4, 5 e 6, representando domingo, segunda, terça, quarta, quinta, sexta e sábado, respectivamente. Por exemplo, 1,2 indica vigência na segunda e terça-feira.

  • Se RecurrenceType for Monthly, informe dois valores no formato A-B. Valores válidos para A e B: 1 a 31, sendo B maior ou igual a A. Exemplo: 1-5 indica vigência diária do primeiro ao quinto dia de cada mês.

Nota

Especifique RecurrenceType e RecurrenceValue.

StartHour

Integer

Não

Não

Horário de início do período de garantia para a reserva de capacidade da garantia de elasticidade segmentada por tempo.

Especifique uma hora cheia.

Nota

Defina StartHour e EndHour. A diferença entre eles deve ser de, no mínimo, 4 horas.

Sintaxe de Tags

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Propriedades de Tags

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Value

String

Não

Não

Valor da tag a adicionar à garantia de elasticidade.

O valor da tag pode ser uma string vazia. Deve ter no máximo 128 caracteres e não pode começar com acs:. Também não pode conter http:// ou https://.

Key

String

Não

Não

Chave da tag a adicionar à garantia de elasticidade.

A chave da tag não pode ser vazia. Deve ter até 128 caracteres e não pode iniciar com aliyun ou acs:. Além disso, não pode conter http:// ou https://.

Valores de retorno

Fn::GetAtt

PrivatePoolOptionsId: o ID da garantia de elasticidade.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Description:
    AssociationProperty: TextArea
    Description:
      en: 'The description of the elasticity assurance. The description must be 2
        to 256 characters in length and cannot start with http:// or https://.

        This parameter is empty by default.'
    Required: false
    Type: String
  InstanceAmount:
    Description:
      en: 'The total number of instances for which to reserve capacity of an instance
        type.

        Valid values: 1 to 1000.'
    MaxValue: 1000
    MinValue: 1
    Required: true
    Type: Number
  InstanceTypes:
    AssociationProperty: List[Parameter]
    AssociationPropertyMetadata:
      Parameter:
        Required: false
        Type: String
    Description:
      en: Instance type. Currently, an elasticity assurance can be created to reserve
        the capacity of a single instance type.
    MaxLength: 1
    MinLength: 1
    Required: true
    Type: Json
  Period:
    AssociationProperty: PayPeriod
    Description:
      en: 'The effective duration of the elasticity assurance. The unit of the effective
        duration is determined by the PeriodUnit value. Valid values:

        When the PeriodUnit parameter is set to Month, the valid values are 1, 2,
        3, 4, 5, 6, 7, 8, and 9.

        When the PeriodUnit parameter is set to Year, the valid values are 1, 2, 3,
        4, and 5.

        Default value: 1.'
    Required: false
    Type: Number
  PeriodUnit:
    AllowedValues:
    - Month
    - Year
    AssociationProperty: PayPeriodUnit
    Description:
      en: 'The unit of the effective duration of the elasticity assurance. Valid values:

        Month

        Year

        Default value: Year.'
    Required: false
    Type: String
  PrivatePoolOptions:
    AssociationPropertyMetadata:
      Parameters:
        MatchCriteria:
          AllowedValues:
          - Open
          - Target
          Description:
            en: 'The type of the private pool with which to associate the elasticity
              assurance. Valid values:

              Open: open private pool

              Target: targeted private pool

              Default value: Open.'
          Required: false
          Type: String
        Name:
          Description:
            en: The name of the elasticity assurance. The description must be 2 to
              128 characters in length. The description must start with a letter but
              cannot start with http:// or https://. It can contain letters, digits,
              colons (:), underscores (_), and hyphens (-).
          Required: false
          Type: String
    Required: false
    Type: Json
  ResourceGroupId:
    AssociationProperty: ALIYUN::ECS::ResourceGroup::ResourceGroupId
    Description:
      en: The ID of the resource group to which to assign the elasticity assurance.
    Required: false
    Type: String
  StartTime:
    Description:
      en: The time when the elasticity assurance takes effect. The default value is
        the time when the CreateElasticityAssurance operation is called to create
        the elasticity assurance. Specify the time in the ISO 8601 standard in the
        yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For more information,
        see ISO 8601.
    Required: false
    Type: String
  Tags:
    AssociationProperty: List[Parameters]
    AssociationPropertyMetadata:
      ListMetadata:
        Order:
        - Key
        - Value
      Parameters:
        Key:
          Description:
            en: 'The key of tag N to add to the elasticity assurance. Valid values
              of N: 1 to 20. The tag key cannot be an empty string. The tag key must
              be 1 to 128 characters in length and cannot contain http:// or https://.
              The tag key cannot start with acs: or aliyun.'
          Required: false
          Type: String
        Value:
          Description:
            en: 'The value of tag N to add to the elasticity assurance. Valid values
              of N: 1 to 20. The tag value can be an empty string. The tag value can
              be up to 128 characters in length and cannot start with acs:. The tag
              value cannot contain http:// or https://.'
          Required: false
          Type: String
    MaxLength: 20
    Required: false
    Type: Json
  ZoneId:
    AssociationProperty: ZoneId
    Description:
      en: The zone ID of the elasticity assurance. Currently, an elasticity assurance
        can be used to reserve resources within a single zone.
    Required: true
    Type: String
Resources:
  ElasticityAssurance:
    Properties:
      Description:
        Ref: Description
      InstanceAmount:
        Ref: InstanceAmount
      InstanceTypes:
        Ref: InstanceTypes
      Period:
        Ref: Period
      PeriodUnit:
        Ref: PeriodUnit
      PrivatePoolOptions:
        Ref: PrivatePoolOptions
      ResourceGroupId:
        Ref: ResourceGroupId
      StartTime:
        Ref: StartTime
      Tags:
        Ref: Tags
      ZoneId:
        Ref: ZoneId
    Type: ALIYUN::ECS::ElasticityAssurance
Outputs:
  PrivatePoolOptionsId:
    Description: The ID of the elasticity assurance.
    Value:
      Fn::GetAtt:
      - ElasticityAssurance
      - PrivatePoolOptionsId
                        
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Description": {
      "AssociationProperty": "TextArea",
      "Type": "String",
      "Description": {
        "en": "The description of the elasticity assurance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.\nThis parameter is empty by default."
      },
      "Required": false
    },
    "InstanceAmount": {
      "Type": "Number",
      "Description": {
        "en": "The total number of instances for which to reserve capacity of an instance type.\nValid values: 1 to 1000."
      },
      "Required": true,
      "MinValue": 1,
      "MaxValue": 1000
    },
    "PrivatePoolOptions": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "MatchCriteria": {
            "Type": "String",
            "Description": {
              "en": "The type of the private pool with which to associate the elasticity assurance. Valid values:\nOpen: open private pool\nTarget: targeted private pool\nDefault value: Open."
            },
            "AllowedValues": [
              "Open",
              "Target"
            ],
            "Required": false
          },
          "Name": {
            "Type": "String",
            "Description": {
              "en": "The name of the elasticity assurance. The description must be 2 to 128 characters in length. The description must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-)."
            },
            "Required": false
          }
        }
      },
      "Type": "Json",
      "Required": false
    },
    "ZoneId": {
      "AssociationProperty": "ZoneId",
      "Type": "String",
      "Description": {
        "en": "The zone ID of the elasticity assurance. Currently, an elasticity assurance can be used to reserve resources within a single zone."
      },
      "Required": true
    },
    "ResourceGroupId": {
      "AssociationProperty": "ALIYUN::ECS::ResourceGroup::ResourceGroupId",
      "Type": "String",
      "Description": {
        "en": "The ID of the resource group to which to assign the elasticity assurance."
      },
      "Required": false
    },
    "StartTime": {
      "Type": "String",
      "Description": {
        "en": "The time when the elasticity assurance takes effect. The default value is the time when the CreateElasticityAssurance operation is called to create the elasticity assurance. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For more information, see ISO 8601."
      },
      "Required": false
    },
    "Period": {
      "AssociationProperty": "PayPeriod",
      "Type": "Number",
      "Description": {
        "en": "The effective duration of the elasticity assurance. The unit of the effective duration is determined by the PeriodUnit value. Valid values:\nWhen the PeriodUnit parameter is set to Month, the valid values are 1, 2, 3, 4, 5, 6, 7, 8, and 9.\nWhen the PeriodUnit parameter is set to Year, the valid values are 1, 2, 3, 4, and 5.\nDefault value: 1."
      },
      "Required": false
    },
    "InstanceTypes": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Required": false
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "Instance type. Currently, an elasticity assurance can be created to reserve the capacity of a single instance type."
      },
      "Required": true,
      "MinLength": 1,
      "MaxLength": 1
    },
    "Tags": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Value": {
            "Type": "String",
            "Description": {
              "en": "The value of tag N to add to the elasticity assurance. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with acs:. The tag value cannot contain http:// or https://."
            },
            "Required": false
          },
          "Key": {
            "Type": "String",
            "Description": {
              "en": "The key of tag N to add to the elasticity assurance. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key must be 1 to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun."
            },
            "Required": false
          }
        },
        "ListMetadata": {
          "Order": [
            "Key",
            "Value"
          ]
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Required": false,
      "MaxLength": 20
    },
    "PeriodUnit": {
      "AssociationProperty": "PayPeriodUnit",
      "Type": "String",
      "Description": {
        "en": "The unit of the effective duration of the elasticity assurance. Valid values:\nMonth\nYear\nDefault value: Year."
      },
      "AllowedValues": [
        "Month",
        "Year"
      ],
      "Required": false
    }
  },
  "Resources": {
    "ElasticityAssurance": {
      "Type": "ALIYUN::ECS::ElasticityAssurance",
      "Properties": {
        "Description": {
          "Ref": "Description"
        },
        "InstanceAmount": {
          "Ref": "InstanceAmount"
        },
        "PrivatePoolOptions": {
          "Ref": "PrivatePoolOptions"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        },
        "StartTime": {
          "Ref": "StartTime"
        },
        "Period": {
          "Ref": "Period"
        },
        "InstanceTypes": {
          "Ref": "InstanceTypes"
        },
        "Tags": {
          "Ref": "Tags"
        },
        "PeriodUnit": {
          "Ref": "PeriodUnit"
        }
      }
    }
  },
  "Outputs": {
    "PrivatePoolOptionsId": {
      "Description": "The ID of the elasticity assurance.",
      "Value": {
        "Fn::GetAtt": [
          "ElasticityAssurance",
          "PrivatePoolOptionsId"
        ]
      }
    }
  }
}