Rule
A forwarding rule is configured in HTTP/HTTPS listener and it used to listen a list of backend servers which in one specified virtual backend server group.
You can add forwarding rules to a listener to forward requests based on the domain names or the URL in the request.
NOTE: One virtual backend server group can be attached in multiple forwarding rules.
NOTE: At least one “Domain” or “Url” must be specified when creating a new rule.
NOTE: Having the same ‘Domain’ and ‘Url’ rule can not be created repeatedly in the one listener.
NOTE: Rule only be created in the
HTTPorHTTPSlistener.NOTE: Only rule’s virtual server group can be modified.
Example Usage
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.Get("name") ?? "slbrulebasicconfig";
var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
{
AvailableDiskCategory = "cloud_efficiency",
AvailableResourceCreation = "VSwitch",
}));
var defaultInstanceTypes = defaultZones.Apply(defaultZones => Output.Create(AliCloud.Ecs.GetInstanceTypes.InvokeAsync(new AliCloud.Ecs.GetInstanceTypesArgs
{
AvailabilityZone = defaultZones.Zones[0].Id,
CpuCoreCount = 1,
MemorySize = 2,
})));
var defaultImages = Output.Create(AliCloud.Ecs.GetImages.InvokeAsync(new AliCloud.Ecs.GetImagesArgs
{
MostRecent = true,
NameRegex = "^ubuntu_18.*64",
Owners = "system",
}));
var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
{
CidrBlock = "172.16.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
{
AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
CidrBlock = "172.16.0.0/16",
VpcId = defaultNetwork.Id,
});
var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new AliCloud.Ecs.SecurityGroupArgs
{
VpcId = defaultNetwork.Id,
});
var defaultInstance = new AliCloud.Ecs.Instance("defaultInstance", new AliCloud.Ecs.InstanceArgs
{
AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
ImageId = defaultImages.Apply(defaultImages => defaultImages.Images[0].Id),
InstanceChargeType = "PostPaid",
InstanceName = name,
InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.InstanceTypes[0].Id),
InternetChargeType = "PayByTraffic",
InternetMaxBandwidthOut = 10,
SecurityGroups =
{
defaultSecurityGroup,
}.Select(__item => __item.Id).ToList(),
SystemDiskCategory = "cloud_efficiency",
VswitchId = defaultSwitch.Id,
});
var defaultLoadBalancer = new AliCloud.Slb.LoadBalancer("defaultLoadBalancer", new AliCloud.Slb.LoadBalancerArgs
{
VswitchId = defaultSwitch.Id,
});
var defaultListener = new AliCloud.Slb.Listener("defaultListener", new AliCloud.Slb.ListenerArgs
{
BackendPort = 22,
Bandwidth = 5,
FrontendPort = 22,
HealthCheckConnectPort = 20,
LoadBalancerId = defaultLoadBalancer.Id,
Protocol = "http",
});
var defaultServerGroup = new AliCloud.Slb.ServerGroup("defaultServerGroup", new AliCloud.Slb.ServerGroupArgs
{
LoadBalancerId = defaultLoadBalancer.Id,
Servers =
{
new AliCloud.Slb.Inputs.ServerGroupServerArgs
{
Port = 80,
ServerIds =
{
defaultInstance,
}.Select(__item => __item.Id).ToList(),
Weight = 100,
},
},
});
var defaultRule = new AliCloud.Slb.Rule("defaultRule", new AliCloud.Slb.RuleArgs
{
Cookie = "23ffsa",
CookieTimeout = 100,
Domain = "*.aliyun.com",
FrontendPort = defaultListener.FrontendPort,
HealthCheck = "on",
HealthCheckConnectPort = 80,
HealthCheckDomain = "test",
HealthCheckHttpCode = "http_2xx",
HealthCheckInterval = 10,
HealthCheckTimeout = 30,
HealthCheckUri = "/test",
HealthyThreshold = 3,
ListenerSync = "off",
LoadBalancerId = defaultLoadBalancer.Id,
Scheduler = "rr",
ServerGroupId = defaultServerGroup.Id,
StickySession = "on",
StickySessionType = "server",
UnhealthyThreshold = 5,
Url = "/image",
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "slbrulebasicconfig"
default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
available_resource_creation="VSwitch")
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0]["id"],
cpu_core_count=1,
memory_size=2)
default_images = alicloud.ecs.get_images(most_recent=True,
name_regex="^ubuntu_18.*64",
owners="system")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
availability_zone=default_zones.zones[0]["id"],
cidr_block="172.16.0.0/16",
vpc_id=default_network.id)
default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
default_instance = alicloud.ecs.Instance("defaultInstance",
availability_zone=default_zones.zones[0]["id"],
image_id=default_images.images[0]["id"],
instance_charge_type="PostPaid",
instance_name=name,
instance_type=default_instance_types.instance_types[0]["id"],
internet_charge_type="PayByTraffic",
internet_max_bandwidth_out="10",
security_groups=[__item.id for __item in [default_security_group]],
system_disk_category="cloud_efficiency",
vswitch_id=default_switch.id)
default_load_balancer = alicloud.slb.LoadBalancer("defaultLoadBalancer", vswitch_id=default_switch.id)
default_listener = alicloud.slb.Listener("defaultListener",
backend_port=22,
bandwidth=5,
frontend_port=22,
health_check_connect_port="20",
load_balancer_id=default_load_balancer.id,
protocol="http")
default_server_group = alicloud.slb.ServerGroup("defaultServerGroup",
load_balancer_id=default_load_balancer.id,
servers=[{
"port": 80,
"serverIds": [__item.id for __item in [default_instance]],
"weight": 100,
}])
default_rule = alicloud.slb.Rule("defaultRule",
cookie="23ffsa",
cookie_timeout=100,
domain="*.aliyun.com",
frontend_port=default_listener.frontend_port,
health_check="on",
health_check_connect_port=80,
health_check_domain="test",
health_check_http_code="http_2xx",
health_check_interval=10,
health_check_timeout=30,
health_check_uri="/test",
healthy_threshold=3,
listener_sync="off",
load_balancer_id=default_load_balancer.id,
scheduler="rr",
server_group_id=default_server_group.id,
sticky_session="on",
sticky_session_type="server",
unhealthy_threshold=5,
url="/image")import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "slbrulebasicconfig";
const defaultZones = pulumi.output(alicloud.getZones({
availableDiskCategory: "cloud_efficiency",
availableResourceCreation: "VSwitch",
}, { async: true }));
const defaultInstanceTypes = defaultZones.apply(defaultZones => alicloud.ecs.getInstanceTypes({
availabilityZone: defaultZones.zones[0].id,
cpuCoreCount: 1,
memorySize: 2,
}, { async: true }));
const defaultImages = pulumi.output(alicloud.ecs.getImages({
mostRecent: true,
nameRegex: "^ubuntu_18.*64",
owners: "system",
}, { async: true }));
const defaultNetwork = new alicloud.vpc.Network("default", {
cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
availabilityZone: defaultZones.zones[0].id,
cidrBlock: "172.16.0.0/16",
vpcId: defaultNetwork.id,
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
vpcId: defaultNetwork.id,
});
const defaultInstance = new alicloud.ecs.Instance("default", {
availabilityZone: defaultZones.zones[0].id,
imageId: defaultImages.images[0].id,
instanceChargeType: "PostPaid",
instanceName: name,
instanceType: defaultInstanceTypes.instanceTypes[0].id,
internetChargeType: "PayByTraffic",
internetMaxBandwidthOut: 10,
securityGroups: defaultSecurityGroup.id,
systemDiskCategory: "cloud_efficiency",
vswitchId: defaultSwitch.id,
});
const defaultLoadBalancer = new alicloud.slb.LoadBalancer("default", {
vswitchId: defaultSwitch.id,
});
const defaultListener = new alicloud.slb.Listener("default", {
backendPort: 22,
bandwidth: 5,
frontendPort: 22,
healthCheckConnectPort: 20,
loadBalancerId: defaultLoadBalancer.id,
protocol: "http",
});
const defaultServerGroup = new alicloud.slb.ServerGroup("default", {
loadBalancerId: defaultLoadBalancer.id,
servers: [{
port: 80,
serverIds: defaultInstance.id,
weight: 100,
}],
});
const defaultRule = new alicloud.slb.Rule("default", {
cookie: "23ffsa",
cookieTimeout: 100,
domain: "*.aliyun.com",
frontendPort: defaultListener.frontendPort,
healthCheck: "on",
healthCheckConnectPort: 80,
healthCheckDomain: "test",
healthCheckHttpCode: "http_2xx",
healthCheckInterval: 10,
healthCheckTimeout: 30,
healthCheckUri: "/test",
healthyThreshold: 3,
listenerSync: "off",
loadBalancerId: defaultLoadBalancer.id,
scheduler: "rr",
serverGroupId: defaultServerGroup.id,
stickySession: "on",
stickySessionType: "server",
unhealthyThreshold: 5,
url: "/image",
});Create a Rule Resource
new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);def Rule(resource_name, opts=None, cookie=None, cookie_timeout=None, delete_protection_validation=None, domain=None, frontend_port=None, health_check=None, health_check_connect_port=None, health_check_domain=None, health_check_http_code=None, health_check_interval=None, health_check_timeout=None, health_check_uri=None, healthy_threshold=None, listener_sync=None, load_balancer_id=None, name=None, scheduler=None, server_group_id=None, sticky_session=None, sticky_session_type=None, unhealthy_threshold=None, url=None, __props__=None);public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Rule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Rule resource accepts the following input properties:
- Frontend
Port int The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].
- Load
Balancer stringId The Load Balancer ID which is used to launch the new forwarding rule.
- Server
Group stringId ID of a virtual server group that will be forwarded.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- int
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- Delete
Protection boolValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Domain string
Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported: - Standard domain name: www.test.com - Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)
- Health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.- Health
Check intConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- Health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- Health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- Health
Check intInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- Health
Check intTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- Health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- Healthy
Threshold int Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Listener
Sync string Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.
- Name string
Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.
- Scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.- Sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff. This parameter is required and takes effect only when ListenerSync is set to off.- Sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- Unhealthy
Threshold int Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Url string
Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-’ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.
- Frontend
Port int The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].
- Load
Balancer stringId The Load Balancer ID which is used to launch the new forwarding rule.
- Server
Group stringId ID of a virtual server group that will be forwarded.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- int
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- Delete
Protection boolValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Domain string
Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported: - Standard domain name: www.test.com - Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)
- Health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.- Health
Check intConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- Health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- Health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- Health
Check intInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- Health
Check intTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- Health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- Healthy
Threshold int Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Listener
Sync string Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.
- Name string
Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.
- Scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.- Sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff. This parameter is required and takes effect only when ListenerSync is set to off.- Sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- Unhealthy
Threshold int Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Url string
Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-’ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.
- frontend
Port number The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].
- load
Balancer stringId The Load Balancer ID which is used to launch the new forwarding rule.
- server
Group stringId ID of a virtual server group that will be forwarded.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- number
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- delete
Protection booleanValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain string
Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported: - Standard domain name: www.test.com - Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)
- health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.- health
Check numberConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- health
Check numberInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- health
Check numberTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- healthy
Threshold number Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- listener
Sync string Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.
- name string
Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.
- scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.- sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff. This parameter is required and takes effect only when ListenerSync is set to off.- sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- unhealthy
Threshold number Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- url string
Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-’ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.
- frontend_
port float The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].
- load_
balancer_ strid The Load Balancer ID which is used to launch the new forwarding rule.
- server_
group_ strid ID of a virtual server group that will be forwarded.
- str
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- float
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- delete_
protection_ boolvalidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain str
Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported: - Standard domain name: www.test.com - Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)
- health_
check str Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.- health_
check_ floatconnect_ port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- health_
check_ strdomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- health_
check_ strhttp_ code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- health_
check_ floatinterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- health_
check_ floattimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- health_
check_ struri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- healthy_
threshold float Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- listener_
sync str Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.
- name str
Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.
- scheduler str
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.- sticky_
session str Whether to enable session persistence, Valid values are
onandoff. Default tooff. This parameter is required and takes effect only when ListenerSync is set to off.- sticky_
session_ strtype Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- unhealthy_
threshold float Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- url str
Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-’ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.
Outputs
All input properties are implicitly available as output properties. Additionally, the Rule resource produces the following output properties:
Look up an Existing Rule Resource
Get an existing Rule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RuleState, opts?: CustomResourceOptions): Rulestatic get(resource_name, id, opts=None, cookie=None, cookie_timeout=None, delete_protection_validation=None, domain=None, frontend_port=None, health_check=None, health_check_connect_port=None, health_check_domain=None, health_check_http_code=None, health_check_interval=None, health_check_timeout=None, health_check_uri=None, healthy_threshold=None, listener_sync=None, load_balancer_id=None, name=None, scheduler=None, server_group_id=None, sticky_session=None, sticky_session_type=None, unhealthy_threshold=None, url=None, __props__=None);public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- int
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- Delete
Protection boolValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Domain string
Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported: - Standard domain name: www.test.com - Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)
- Frontend
Port int The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].
- Health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.- Health
Check intConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- Health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- Health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- Health
Check intInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- Health
Check intTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- Health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- Healthy
Threshold int Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Listener
Sync string Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.
- Load
Balancer stringId The Load Balancer ID which is used to launch the new forwarding rule.
- Name string
Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.
- Scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.- Server
Group stringId ID of a virtual server group that will be forwarded.
- Sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff. This parameter is required and takes effect only when ListenerSync is set to off.- Sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- Unhealthy
Threshold int Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Url string
Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-’ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- int
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- Delete
Protection boolValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Domain string
Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported: - Standard domain name: www.test.com - Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)
- Frontend
Port int The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].
- Health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.- Health
Check intConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- Health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- Health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- Health
Check intInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- Health
Check intTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- Health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- Healthy
Threshold int Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Listener
Sync string Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.
- Load
Balancer stringId The Load Balancer ID which is used to launch the new forwarding rule.
- Name string
Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.
- Scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.- Server
Group stringId ID of a virtual server group that will be forwarded.
- Sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff. This parameter is required and takes effect only when ListenerSync is set to off.- Sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- Unhealthy
Threshold int Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Url string
Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-’ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- number
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- delete
Protection booleanValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain string
Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported: - Standard domain name: www.test.com - Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)
- frontend
Port number The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].
- health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.- health
Check numberConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- health
Check numberInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- health
Check numberTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- healthy
Threshold number Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- listener
Sync string Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.
- load
Balancer stringId The Load Balancer ID which is used to launch the new forwarding rule.
- name string
Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.
- scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.- server
Group stringId ID of a virtual server group that will be forwarded.
- sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff. This parameter is required and takes effect only when ListenerSync is set to off.- sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- unhealthy
Threshold number Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- url string
Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-’ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.
- str
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- float
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- delete_
protection_ boolvalidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- domain str
Domain name of the forwarding rule. It can contain letters a-z, numbers 0-9, hyphens (-), and periods (.), and wildcard characters. The following two domain name formats are supported: - Standard domain name: www.test.com - Wildcard domain name: .test.com. wildcard () must be the first character in the format of (*.)
- frontend_
port float The listener frontend port which is used to launch the new forwarding rule. Valid range: [1-65535].
- health_
check str Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener. This parameter is required and takes effect only when ListenerSync is set to off.- health_
check_ floatconnect_ port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- health_
check_ strdomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- health_
check_ strhttp_ code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- health_
check_ floatinterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- health_
check_ floattimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- health_
check_ struri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- healthy_
threshold float Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- listener_
sync str Indicates whether a forwarding rule inherits the settings of a health check , session persistence, and scheduling algorithm from a listener. Default to on.
- load_
balancer_ strid The Load Balancer ID which is used to launch the new forwarding rule.
- name str
Name of the forwarding rule. Our plugin provides a default name: “tf-slb-rule”.
- scheduler str
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”. This parameter is required and takes effect only when ListenerSync is set to off.- server_
group_ strid ID of a virtual server group that will be forwarded.
- sticky_
session str Whether to enable session persistence, Valid values are
onandoff. Default tooff. This parameter is required and takes effect only when ListenerSync is set to off.- sticky_
session_ strtype Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- unhealthy_
threshold float Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- url str
Domain of the forwarding rule. It must be 2-80 characters in length. Only letters a-z, numbers 0-9, and characters ‘-’ ‘/’ ‘?’ ‘%’ ‘#’ and ‘&’ are allowed. URLs must be started with the character ‘/’, but cannot be ‘/’ alone.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.