Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ECS::Activation

Última atualização: Jun 27, 2026

Crie um código de ativação para registrar servidores fora da Alibaba Cloud como instâncias gerenciadas da Alibaba Cloud.

Nota

Após a criação do código de ativação, use-o para registrar servidores não fornecidos pela Alibaba Cloud como instâncias gerenciadas da Alibaba Cloud.

Sintaxe

{
  "Type": "ALIYUN::ECS::Activation",
  "Properties": {
    "InstanceName": String,
    "InstanceCount": Integer,
    "Description": String,
    "TimeToLiveInHours": Integer,
    "IpAddressRange": String,
    "ResourceGroupId": String,
    "Tags": List
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

InstanceName

String

Não

Não

Prefixo padrão para nomes de instância.

O prefixo deve ter de 2 a 50 caracteres e pode conter apenas pontos (.), sublinhados (_), hifens (-) e dois-pontos (:). Deve começar com uma letra e não pode iniciar com caractere especial, dígito, http:// ou https://.

Ao usar o código de ativação criado via ALIYUN::ECS::Activation para registrar instâncias gerenciadas, as instâncias recebem nomes sequenciais com o prefixo definido nesta propriedade. Você também pode especificar um novo nome de instância para substituir o nome sequencial atribuído durante o registro.

Se você especificar InstanceName ao registrar uma instância gerenciada, o sistema gera um nome no formato <InstanceName>-<Number>. A quantidade de dígitos em <Number> varia conforme o número de dígitos do valor de InstanceCount. Exemplo de Number: 001. Caso você não especifique InstanceName, o hostname (Hostname) será usado como nome da instância.

InstanceCount

Integer

Não

Não

Número máximo de instâncias gerenciadas que podem ser registradas com este código de ativação.

Valores válidos: 1 a 1000.

Valor padrão: 10.

Description

String

Não

Não

Descrição do código de ativação.

A descrição deve ter de 1 a 100 caracteres.

TimeToLiveInHours

Integer

Não

Não

Período de validade do código de ativação, em horas.

O código de ativação não pode ser usado para registrar novas instâncias após a expiração. Valores válidos: 1 a 876576 (de 1 hora a 100 anos).

Valor padrão: 4.

IpAddressRange

String

Não

Não

Endereços IP dos hosts autorizados a usar o código de ativação.

O valor pode incluir endereços IPv4, endereços IPv6 ou blocos CIDR.

ResourceGroupId

String

Não

Sim

ID do grupo de recursos.

Nenhuma.

Tags

List

Não

Sim

As tags.

Você pode adicionar de 1 a 20 tags. Para mais informações, consulte Propriedades de Tags.

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.

O valor pode ser uma string vazia.

Key

String

Sim

Não

Chave da tag.

A chave não pode ser uma string vazia.

Valores de retorno

Fn::GetAtt

  • DeregisteredCount: número de instâncias canceladas.

  • ActivationId: ID do código de ativação.

  • RegisteredCount: número de instâncias registradas.

  • ActivationCode: valor do código de ativação.

  • Arn: Alibaba Cloud Resource Name (ARN).

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Description:
    Description:
      en: The description of the activation code. It must be 1 to 100 characters in
        length.
    MaxLength: 100
    MinLength: 1
    Type: String
  InstanceCount:
    Description:
      en: 'The maximum number of times that you can use the activation code to register
        managed instances. Valid values: 1 to 1000.Default value: 10.'
    MaxValue: 1000
    MinValue: 1
    Type: Number
  InstanceName:
    Description:
      en: 'The default instance name prefix. The instance name prefix must be 2 to
        50 characters in length. It must start with a letter and cannot start with
        http:// or https://. It can contain letters, digits, periods (.), underscores
        (_), hyphens (-), and colons (:). If you use the activation code that is created
        by calling this operation (CreateActivation) to register managed instances,
        the instances are assigned sequential names that are prefixed by the value
        of this parameter. You can also specify a new instance name to replace the
        assigned sequential name when you register a managed instance.If you specify
        InstanceName when you register a managed instance, an instance name in theformat
        of - is generated. The number of digits in the 
        value isdetermined by that in the InstanceCount value. Example: 001. If you
        do not specify InstanceName, the hostname (Hostname) is used as the instance
        name.'
    Type: String
  IpAddressRange:
    Description:
      en: The IP addresses of hosts that are allowed to use the activation code. The
        value can be IPv4 addresses, IPv6 addresses, or CIDR blocks.
    Type: String
  RegionId:
    Description:
      en: Region ID of instance. Default is current region.
    Type: String
  Tags:
    AssociationProperty: List[Parameter]
    AssociationPropertyMetadata:
      Parameter:
        AssociationPropertyMetadata:
          Parameters:
            Key:
              Type: String
            Value:
              Type: String
        Type: Json
    Description:
      en: Tags to attach to instance. Max support 20 tags to add during create instance.
        Each tag with two properties Key and Value, and Key is required.
    MaxLength: 20
    Type: Json
  TimeToLiveInHours:
    Description:
      en: 'The validity period of the activation code. The activation code can no
        longer be used to register instances after the period ends. Unit: hours. Valid
        values: 1 to 876576, which represents a range of time from 1 hour to 100 years.Default
        value: 4.'
    MaxValue: 876576
    MinValue: 1
    Type: Number
Resources:
  Activation:
    Properties:
      Description:
        Ref: Description
      InstanceCount:
        Ref: InstanceCount
      InstanceName:
        Ref: InstanceName
      IpAddressRange:
        Ref: IpAddressRange
      RegionId:
        Ref: RegionId
      Tags:
        Ref: Tags
      TimeToLiveInHours:
        Ref: TimeToLiveInHours
    Type: ALIYUN::ECS::Activation
Outputs:
  ActivationCode:
    Description: Activation code.
    Value:
      Fn::GetAtt:
      - Activation
      - ActivationCode
  ActivationId:
    Description: Activation code ID.
    Value:
      Fn::GetAtt:
      - Activation
      - ActivationId
  DeregisteredCount:
    Description: The number of instances that have been logged out.
    Value:
      Fn::GetAtt:
      - Activation
      - DeregisteredCount
  RegisteredCount:
    Description: The number of registered instances.
    Value:
      Fn::GetAtt:
      - Activation
      - RegisteredCount
                        
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceName": {
      "Type": "String",
      "Description": {
        "en": "The default instance name prefix. The instance name prefix must be 2 to 50 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, periods (.), underscores (_), hyphens (-), and colons (:). If you use the activation code that is created by calling this operation (CreateActivation) to register managed instances, the instances are assigned sequential names that are prefixed by the value of this parameter. You can also specify a new instance name to replace the assigned sequential name when you register a managed instance.If you specify InstanceName when you register a managed instance, an instance name in theformat of - is generated. The number of digits in the  value isdetermined by that in the InstanceCount value. Example: 001. If you do not specify InstanceName, the hostname (Hostname) is used as the instance name."
      }
    },
    "InstanceCount": {
      "Type": "Number",
      "Description": {
        "en": "The maximum number of times that you can use the activation code to register managed instances. Valid values: 1 to 1000.Default value: 10."
      },
      "MinValue": 1,
      "MaxValue": 1000
    },
    "Description": {
      "Type": "String",
      "Description": {
        "en": "The description of the activation code. It must be 1 to 100 characters in length."
      },
      "MinLength": 1,
      "MaxLength": 100
    },
    "TimeToLiveInHours": {
      "Type": "Number",
      "Description": {
        "en": "The validity period of the activation code. The activation code can no longer be used to register instances after the period ends. Unit: hours. Valid values: 1 to 876576, which represents a range of time from 1 hour to 100 years.Default value: 4."
      },
      "MinValue": 1,
      "MaxValue": 876576
    },
    "RegionId": {
      "Type": "String",
      "Description": {
        "en": "Region ID of instance. Default is current region."
      }
    },
    "IpAddressRange": {
      "Type": "String",
      "Description": {
        "en": "The IP addresses of hosts that are allowed to use the activation code. The value can be IPv4 addresses, IPv6 addresses, or CIDR blocks."
      }
    },
    "Tags": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "Value": {
                "Type": "String"
              },
              "Key": {
                "Type": "String"
              }
            }
          },
          "Type": "Json"
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "Tags to attach to instance. Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required."
      },
      "MaxLength": 20
    }
  },
  "Resources": {
    "Activation": {
      "Type": "ALIYUN::ECS::Activation",
      "Properties": {
        "InstanceName": {
          "Ref": "InstanceName"
        },
        "InstanceCount": {
          "Ref": "InstanceCount"
        },
        "Description": {
          "Ref": "Description"
        },
        "TimeToLiveInHours": {
          "Ref": "TimeToLiveInHours"
        },
        "RegionId": {
          "Ref": "RegionId"
        },
        "IpAddressRange": {
          "Ref": "IpAddressRange"
        },
        "Tags": {
          "Ref": "Tags"
        }
      }
    }
  },
  "Outputs": {
    "DeregisteredCount": {
      "Description": "The number of instances that have been logged out.",
      "Value": {
        "Fn::GetAtt": [
          "Activation",
          "DeregisteredCount"
        ]
      }
    },
    "ActivationId": {
      "Description": "Activation code ID.",
      "Value": {
        "Fn::GetAtt": [
          "Activation",
          "ActivationId"
        ]
      }
    },
    "RegisteredCount": {
      "Description": "The number of registered instances.",
      "Value": {
        "Fn::GetAtt": [
          "Activation",
          "RegisteredCount"
        ]
      }
    },
    "ActivationCode": {
      "Description": "Activation code.",
      "Value": {
        "Fn::GetAtt": [
          "Activation",
          "ActivationCode"
        ]
      }
    }
  }
}