すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::ECS::Activation

最終更新日:Mar 17, 2025

ALIYUN::ECS::Activation は、アクティベーションコードを作成するために使用されます。

説明

アクティベーションコードは、Alibaba Cloud によって提供されていないサーバーを Alibaba Cloud マネージドインスタンスとして登録するために使用されます。

構文

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

プロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

InstanceName

String

いいえ

いいえ

インスタンス名のデフォルトのプレフィックス。

プレフィックスは 2 ~ 50 文字で、ピリオド (.)、アンダースコア (_)、ハイフン (-)、コロン (:) のみを含めることができます。文字で始まり、特殊文字または数字で始めることはできません。http:// または https:// で始めることはできません。

CreateActivation 操作を呼び出すことによって作成されたアクティベーションコードを使用してマネージドインスタンスを登録する場合、インスタンスには、このプロパティの値がプレフィックスとして付加された連番の名前が割り当てられます。マネージドインスタンスを登録するときに、割り当てられた連番の名前をオーバーライドするために新しいインスタンス名を指定することもできます。

マネージドインスタンスの登録時に InstanceName が指定されている場合、<InstanceName>-<Number> の形式のインスタンス名が生成されます。<Number> 値の桁数は、InstanceCount 値の桁数によって決まります。例:001。マネージドインスタンスの登録時に InstanceName が指定されていない場合は、Hostname で指定されたホスト名がインスタンス名として使用されます。

InstanceCount

Integer

いいえ

いいえ

アクティベーションコードを使用してマネージドインスタンスを登録できる最大回数。

有効な値:1 ~ 1000。

デフォルト値:10。

Description

String

いいえ

いいえ

アクティベーションコードの説明。

説明は 1 ~ 100 文字でなければなりません。

TimeToLiveInHours

Integer

いいえ

いいえ

アクティベーションコードの有効期間。

有効期間が過ぎると、アクティベーションコードを使用して新しいインスタンスを登録することはできません。単位:時間。有効な値:1 ~ 876576。これは、1 時間から 100 年までの期間を表します。

デフォルト値:4。

IpAddressRange

String

いいえ

いいえ

アクティベーションコードの使用が許可されているホストの IP アドレス。

値には、IPv4 アドレス、IPv6 アドレス、または CIDR ブロックを指定できます。

Tags

List

いいえ

はい

タグ。

1 ~ 20 個のタグを指定できます。詳細については、「タグのプロパティ」をご参照ください。

タグの構文

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

タグのプロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

Value

String

いいえ

いいえ

アクティベーションコードに追加するタグの値。

タグ値は空の文字列を指定できます。

Key

String

はい

いいえ

アクティベーションコードに追加するタグのキー。

タグ値が渡される場合、タグキーは空の文字列を指定できません。

戻り値

Fn::GetAtt

  • DeregisteredCount: 登録解除されたインスタンスの数。

  • ActivationId: アクティベーションコードの ID。

  • RegisteredCount: 登録済みインスタンスの数。

  • ActivationCode: アクティベーションコードの値。

  • YAML 形式

    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 the format
            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
                            
  • JSON 形式

    {
      "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 the format 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": "ログアウトされたインスタンスの数",
          "Value": {
            "Fn::GetAtt": [
              "Activation",
              "DeregisteredCount"
            ]
          }
        },
        "ActivationId": {
          "Description": "アクティベーションコード ID",
          "Value": {
            "Fn::GetAtt": [
              "Activation",
              "ActivationId"
            ]
          }
        },
        "RegisteredCount": {
          "Description": "登録済みインスタンスの数",
          "Value": {
            "Fn::GetAtt": [
              "Activation",
              "RegisteredCount"
            ]
          }
        },
        "ActivationCode": {
          "Description": "アクティベーションコード",
          "Value": {
            "Fn::GetAtt": [
              "Activation",
              "ActivationCode"
            ]
          }
        }
      }
    }