Skip to content

LoadBalancer

This class encapsulates and extends the ROS resource type ALIYUN::SLB::LoadBalancer, which is used to create a Server Load Balancer (SLB) instance.

Initializers

import ros_cdk_slb
ros_cdk_slb.LoadBalancer(
  scope: Construct,
  id: str,
  address_ip_version: typing.Union[str, IResolvable] = None,
  address_type: typing.Union[str, IResolvable] = None,
  auto_pay: typing.Union[bool, IResolvable] = None,
  auto_renew: typing.Union[bool, IResolvable] = None,
  auto_renew_period: typing.Union[typing.Union[int, float], IResolvable] = None,
  bandwidth: typing.Union[typing.Union[int, float], IResolvable] = None,
  deletion_protection: typing.Union[bool, IResolvable] = None,
  duration: typing.Union[typing.Union[int, float], IResolvable] = None,
  instance_charge_type: typing.Union[str, IResolvable] = None,
  internet_charge_type: typing.Union[str, IResolvable] = None,
  load_balancer_name: typing.Union[str, IResolvable] = None,
  load_balancer_spec: typing.Union[str, IResolvable] = None,
  master_zone_id: typing.Union[str, IResolvable] = None,
  modification_protection_reason: typing.Union[str, IResolvable] = None,
  modification_protection_status: typing.Union[str, IResolvable] = None,
  pay_type: typing.Union[str, IResolvable] = None,
  pricing_cycle: typing.Union[str, IResolvable] = None,
  resource_group_id: typing.Union[str, IResolvable] = None,
  slave_zone_id: typing.Union[str, IResolvable] = None,
  tags: typing.List[TagsProperty] = None,
  vpc_id: typing.Union[str, IResolvable] = None,
  v_switch_id: typing.Union[str, IResolvable] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
address_ip_version typing.Union[str, ros_cdk_core.IResolvable] Property addressIpVersion: IP version, support 'ipv4' or 'ipv6'.
address_type typing.Union[str, ros_cdk_core.IResolvable] Property addressType: The network type of the CLB instance.
auto_pay typing.Union[bool, ros_cdk_core.IResolvable] Property autoPay: Specifies whether to automatically pay for the subscription Internet-facing CLB instance.
auto_renew typing.Union[bool, ros_cdk_core.IResolvable] Property autoRenew: Indicates whether automatic renewal is enabled for the instance.
auto_renew_period typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property autoRenewPeriod: Automatic renewal cycle, which takes effect when AutoRenew is true, and is required: When PricingCycle = month, the value range is 1 to 9 or 12, 24, 36.
bandwidth typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property bandwidth: The bandwidth for network, unit in Mbps(Mega bit per second).
deletion_protection typing.Union[bool, ros_cdk_core.IResolvable] Property deletionProtection: Whether to enable deletion protection.
duration typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property duration: Optional.
instance_charge_type typing.Union[str, ros_cdk_core.IResolvable] Property instanceChargeType: Instance billing method.
internet_charge_type typing.Union[str, ros_cdk_core.IResolvable] Property internetChargeType: The metering method of the Internet-facing CLB instance.
load_balancer_name typing.Union[str, ros_cdk_core.IResolvable] Property loadBalancerName: Name of created load balancer.
load_balancer_spec typing.Union[str, ros_cdk_core.IResolvable] Property loadBalancerSpec: The specification of the CLB instance.
master_zone_id typing.Union[str, ros_cdk_core.IResolvable] Property masterZoneId: The master zone id to create load balancer instance.
modification_protection_reason typing.Union[str, ros_cdk_core.IResolvable] Property modificationProtectionReason: Set the reason for modifying the protection status.
modification_protection_status typing.Union[str, ros_cdk_core.IResolvable] Property modificationProtectionStatus: NonProtection or empty: means no restriction on modification protection ConsoleProtection: Modify instance protection status by console Default value is empty.
pay_type typing.Union[str, ros_cdk_core.IResolvable] Property payType: Optional.
pricing_cycle typing.Union[str, ros_cdk_core.IResolvable] Property pricingCycle: Optional.
resource_group_id typing.Union[str, ros_cdk_core.IResolvable] Property resourceGroupId: Resource group id.
slave_zone_id typing.Union[str, ros_cdk_core.IResolvable] Property slaveZoneId: The slave zone id to create load balancer instance.
tags typing.List[TagsProperty] Property tags: Tags to attach to slb.
vpc_id typing.Union[str, ros_cdk_core.IResolvable] Property vpcId: The VPC id to create load balancer instance.
v_switch_id typing.Union[str, ros_cdk_core.IResolvable] Property vSwitchId: The VSwitch id to create load balancer instance.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

address_ip_versionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property addressIpVersion: IP version, support 'ipv4' or 'ipv6'.

If 'ipv6' is selected, please note that the zone and the specification are supported.


address_typeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property addressType: The network type of the CLB instance.

Valid values:

  • internet (default): After an internet-facing CLB instance is created, the system assigns a public IP address to the CLB instance. Then, the CLB instance can forward requests over the Internet.
  • intranet: After an internal-facing CLB instance is created, the system assigns a private IP address to the CLB instance. Then, the CLB instance can forward requests only over the internal networks.

auto_payOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property autoPay: Specifies whether to automatically pay for the subscription Internet-facing CLB instance.

Valid values:

  • true: automatically pays for the CLB instance. After you call this operation, the system automatically completes the payment and creates the CLB instance.- false (default): After you call the operation, the order is created but the payment is not completed. You can view the pending order in the console. The CLB instance will not be created until you complete the payment.Note This parameter is supported only by subscription instances created on the Alibaba Cloud China site.

auto_renewOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property autoRenew: Indicates whether automatic renewal is enabled for the instance.

Valid values:- true: Automatic renewal is enabled.- false (default): Automatic renewal is not enabled. You must renew the instance manually.


auto_renew_periodOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property autoRenewPeriod: Automatic renewal cycle, which takes effect when AutoRenew is true, and is required: When PricingCycle = month, the value range is 1 to 9 or 12, 24, 36.

When PeriodUnit = year, the value range is 1-3.


bandwidthOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property bandwidth: The bandwidth for network, unit in Mbps(Mega bit per second).

Default is 1. If InternetChargeType is specified as "paybytraffic", this property will be ignore and please specify the "Bandwidth" in ALIYUN::SLB::Listener.


deletion_protectionOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property deletionProtection: Whether to enable deletion protection.


durationOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property duration: Optional.

The subscription duration of a Subscription Internet instance. Valid values: If PricingCycle is month, the valid range is 1 to 9 or 12, 24, 36, 48, 60. If PricingCycle is year, the value range is 1 to 5.


instance_charge_typeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property instanceChargeType: Instance billing method.

Valid value:

  • PayBySpec (default): Pay by spec.
  • PayByCLCU: billed by usage.

internet_charge_typeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property internetChargeType: The metering method of the Internet-facing CLB instance.

Valid values:

  • paybytraffic (default): If you set the value to paybytraffic, you do not need to specify Bandwidth. Even if you specify Bandwidth, the value does not take effect.
  • paybybandwidth: pay-by-bandwidth. Note If you set PayType to PayOnDemand and set InstanceChargeType to PayByCLCU, you must set InternetChargeType to paybytraffic.

load_balancer_nameOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property loadBalancerName: Name of created load balancer.

Length is limited to 1-80 characters, allowed to contain letters, numbers, '-, /, _,.' When not specified, a default name will be assigned.


load_balancer_specOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property loadBalancerSpec: The specification of the CLB instance.

Valid values:

  • slb.s1.small
  • slb.s2.small
  • slb.s2.medium
  • slb.s3.small
  • slb.s3.medium
  • slb.s3.large Note If you do not specify this parameter, a shared-resource CLB instance is created. Shared-resource CLB instances are no longer available for purchase. Therefore, you must specify this parameter. If InstanceChargeType is set to PayByCLCU, this parameter is invalid and you do not need to specify this parameter.

master_zone_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property masterZoneId: The master zone id to create load balancer instance.


modification_protection_reasonOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property modificationProtectionReason: Set the reason for modifying the protection status.

The length is 1-80 English or Chinese characters, must start with upper and lower letters or Chinese, and can include numbers, periods (.), underscores (_) and dashes (-). Only valid when ModificationProtectionStatus is ConsoleProtection.


modification_protection_statusOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property modificationProtectionStatus: NonProtection or empty: means no restriction on modification protection ConsoleProtection: Modify instance protection status by console Default value is empty.


pay_typeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property payType: Optional.

The billing method of the instance to be created. Valid value: PayOnDemand (Pay-As-You-Go) | PrePay (Subscription)


pricing_cycleOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property pricingCycle: Optional.

The duration of the Subscription-billed Internet instance to be created. Valid values: month | year.


resource_group_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resourceGroupId: Resource group id.


slave_zone_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property slaveZoneId: The slave zone id to create load balancer instance.


tagsOptional

Property tags: Tags to attach to slb.

Max support 5 tags to add during create slb. Each tag with two properties Key and Value, and Key is required.


vpc_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property vpcId: The VPC id to create load balancer instance.

For VPC network only.


v_switch_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property vSwitchId: The VSwitch id to create load balancer instance.

For VPC network only.


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

import ros_cdk_slb
ros_cdk_slb.LoadBalancer.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_address_ip_version ros_cdk_core.IResolvable Attribute AddressIPVersion: IP version.
attr_address_type ros_cdk_core.IResolvable Attribute AddressType: The address type of the load balancer.
attr_bandwidth ros_cdk_core.IResolvable Attribute Bandwidth: The bandwidth for network.
attr_ip_address ros_cdk_core.IResolvable Attribute IpAddress: The ip address of the load balancer.
attr_load_balancer_id ros_cdk_core.IResolvable Attribute LoadBalancerId: The id of load balance created.
attr_load_balancer_name ros_cdk_core.IResolvable Attribute LoadBalancerName: Name of created load balancer.
attr_load_balancer_spec ros_cdk_core.IResolvable Attribute LoadBalancerSpec: The specification of the Server Load Balancer instance.
attr_master_zone_id ros_cdk_core.IResolvable Attribute MasterZoneId: The master zone id to create load balancer instance.
attr_network_type ros_cdk_core.IResolvable Attribute NetworkType: The network type of the load balancer.
attr_order_id ros_cdk_core.IResolvable Attribute OrderId: The order ID.
attr_pay_type ros_cdk_core.IResolvable Attribute PayType: The billing method of the instance to be created.
attr_resource_group_id ros_cdk_core.IResolvable Attribute ResourceGroupId: Resource group id.
attr_slave_zone_id ros_cdk_core.IResolvable Attribute SlaveZoneId: The slave zone id to create load balancer instance.
attr_vpc_id ros_cdk_core.IResolvable Attribute VpcId: Vpc id.
attr_v_switch_id ros_cdk_core.IResolvable Attribute VSwitchId: VSwitch id.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_address_ip_versionRequired

attr_address_ip_version: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute AddressIPVersion: IP version.


attr_address_typeRequired

attr_address_type: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute AddressType: The address type of the load balancer.

"intranet" or "internet".


attr_bandwidthRequired

attr_bandwidth: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute Bandwidth: The bandwidth for network.


attr_ip_addressRequired

attr_ip_address: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute IpAddress: The ip address of the load balancer.


attr_load_balancer_idRequired

attr_load_balancer_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute LoadBalancerId: The id of load balance created.


attr_load_balancer_nameRequired

attr_load_balancer_name: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute LoadBalancerName: Name of created load balancer.


attr_load_balancer_specRequired

attr_load_balancer_spec: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute LoadBalancerSpec: The specification of the Server Load Balancer instance.


attr_master_zone_idRequired

attr_master_zone_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute MasterZoneId: The master zone id to create load balancer instance.


attr_network_typeRequired

attr_network_type: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute NetworkType: The network type of the load balancer.

"vpc" or "classic" network.


attr_order_idRequired

attr_order_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute OrderId: The order ID.


attr_pay_typeRequired

attr_pay_type: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute PayType: The billing method of the instance to be created.


attr_resource_group_idRequired

attr_resource_group_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute ResourceGroupId: Resource group id.


attr_slave_zone_idRequired

attr_slave_zone_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute SlaveZoneId: The slave zone id to create load balancer instance.


attr_vpc_idRequired

attr_vpc_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute VpcId: Vpc id.


attr_v_switch_idRequired

attr_v_switch_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute VSwitchId: VSwitch id.