ALIYUN::SLB::LoadBalancerClone

更新时间:
复制 MD 格式

Clones an SLB instance.

Syntax

{
  "Type": "ALIYUN::SLB::LoadBalancerClone",
  "Properties": {
    "Tags": List,
    "ResourceGroupId": String,
    "VSwitchId": String,
    "LoadBalancerName": String,
    "SourceLoadBalancerId": String,
    "TagsPolicy": String,
    "BackendServersPolicy": String,
    "BackendServers": List,
    "InstanceChargeType": String,
    "LoadBalancerSpec": String
  }
}

Properties

Property name Type Required Update allowed Description Constraints
ResourceGroupId String No No The ID of the resource group. None
VSwitchId String No No The ID of the vSwitch. Must belong to the VPC of the source SLB instance. Default: the source instance's vSwitch.
SourceLoadBalancerId String Yes No The ID of the source SLB instance to clone. None
BackendServersPolicy String No No The backend server cloning policy. Valid values:
  • clone (default): Clones all backend servers and weights from the source instance.
  • empty: Adds no backend servers.
  • append: Clones backend servers from the source instance and adds new ones.
  • replace: Adds only new backend servers without cloning from the source instance.
BackendServers List No Yes The new backend servers to add. BackendServers properties.
LoadBalancerName String No No The name of the SLB instance. 1 to 80 characters. Supports letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).
Tags List No No The tags of the SLB instance. Key-value pairs. Maximum: 5.

Tags properties.

TagsPolicy String No No The tag policy. Valid values:
  • clone: Retains the tags of the source instance.
  • empty (default): Does not set any tags.
  • append: Retains the tags of the source instance and adds new tags.
  • replace: Adds only new tags without retaining the source instance's tags.
InstanceChargeType String No No The billing method of the instance. Valid values:
  • PayBySpec (default): pay-by-specification.
  • PayByCLCU: pay-as-you-go.
    Note Valid only when PayType is set to PayOnDemand.
LoadBalancerSpec String No No The specification of the SLB instance. Valid values:
  • slb.s1.small (default)
  • slb.s2.small
  • slb.s2.medium
  • slb.s3.small
  • slb.s3.medium
  • slb.s3.large
  • slb.s3.xlarge
  • slb.s3.xxlarge

Supported specifications vary by region. FAQ about CLB instances.

BackendServers syntax

"BackendServers": [
  {
    "Type": String,
    "ServerId": String,
    "Description": String,
    "ServerIp": String,
    "Weight": Integer
  }
] 

BackendServers properties

Property name Type Required Update allowed Description Constraints
ServerId String Yes Yes The ID of the backend server. The backend server must be in the running state. Maximum: 20 per call.

Only guaranteed-performance instances support ENI-type backend servers.

Weight Integer Yes Yes The weight of the backend server. Valid values: 0 to 100.

Default value: 100.

ServerIp String No No The IP address of the backend server. None
Type String No No The type of the backend server. Valid values:
  • ecs (default): ECS instance.
  • eni: ENI instance.
  • eci: Elastic Container Instance.
Description String No Yes The description of the backend server. 1 to 80 characters. Supports letters, Chinese characters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).

Tags syntax

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

Tags properties

Property name Type Required Update allowed Description Constraints
Key String Yes No The tag key. 1 to 128 characters. Cannot start with aliyun or acs:. Cannot contain http:// or https://.
Value String No No The tag value. 0 to 128 characters. Cannot start with aliyun or acs:. Cannot contain http:// or https://.

Return value

Fn::GetAtt

LoadBalancerId: The ID of the new SLB instance.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      SourceSLBId:
        AssociationProperty: ALIYUN::SLB::Instance::InstanceId
        Type: String
        Description: The ID of the source SLB instance to clone.
    Resources:
      LoadBalancerClone:
        Type: ALIYUN::SLB::LoadBalancerClone
        Properties:
          LoadBalancerName: DemoCloneLoadBalancer
          SourceLoadBalancerId:
            Ref: SourceSLBId
    Outputs:
      LoadBalancerId:
        Description: The ID of the generated SLB instance.
        Value:
          Fn::GetAtt:
            - LoadBalancerClone
            - LoadBalancerId
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "SourceSLBId": {
          "AssociationProperty": "ALIYUN::SLB::Instance::InstanceId",
          "Type": "String",
          "Description": "The ID of the source SLB instance to clone."
        }
      },
      "Resources": {
        "LoadBalancerClone": {
          "Type": "ALIYUN::SLB::LoadBalancerClone",
          "Properties": {
            "LoadBalancerName": "DemoCloneLoadBalancer",
            "SourceLoadBalancerId": {
              "Ref": "SourceSLBId"
            }
          }
        }
      },
      "Outputs": {
        "LoadBalancerId": {
          "Description": "The ID of the generated SLB instance.",
          "Value": {
            "Fn::GetAtt": [
              "LoadBalancerClone",
              "LoadBalancerId"
            ]
          }
        }
      }
    }