@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
391 lines (390 loc) • 15.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a resource to manage listener
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.ecs.getZones({});
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-test-subnet",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* vpcId: fooVpc.id,
* });
* const fooClb = new volcengine.clb.Clb("fooClb", {
* type: "public",
* subnetId: fooSubnet.id,
* loadBalancerSpec: "small_1",
* description: "acc0Demo",
* loadBalancerName: "acc-test-create",
* eipBillingConfig: {
* isp: "BGP",
* eipBillingType: "PostPaidByBandwidth",
* bandwidth: 1,
* },
* });
* const fooServerGroup = new volcengine.clb.ServerGroup("fooServerGroup", {
* loadBalancerId: fooClb.id,
* serverGroupName: "acc-test-create",
* description: "hello demo11",
* });
* const fooListener = new volcengine.clb.Listener("fooListener", {
* loadBalancerId: fooClb.id,
* listenerName: "acc-test-listener",
* protocol: "HTTP",
* port: 90,
* serverGroupId: fooServerGroup.id,
* healthCheck: {
* enabled: "on",
* interval: 10,
* timeout: 3,
* healthyThreshold: 5,
* unHealthyThreshold: 2,
* domain: "volcengine.com",
* httpCode: "http_2xx",
* method: "GET",
* uri: "/",
* },
* enabled: "on",
* });
* const fooTcp = new volcengine.clb.Listener("fooTcp", {
* loadBalancerId: fooClb.id,
* listenerName: "acc-test-listener",
* protocol: "TCP",
* port: 90,
* serverGroupId: fooServerGroup.id,
* enabled: "on",
* bandwidth: 2,
* proxyProtocolType: "standard",
* persistenceType: "source_ip",
* persistenceTimeout: 100,
* connectionDrainEnabled: "on",
* connectionDrainTimeout: 100,
* });
* ```
*
* ## Import
*
* Listener can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:clb/listener:Listener default lsn-273yv0mhs5xj47fap8sehiiso
* ```
*/
export declare class Listener extends pulumi.CustomResource {
/**
* Get an existing Listener resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ListenerState, opts?: pulumi.CustomResourceOptions): Listener;
/**
* Returns true if the given object is an instance of Listener. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Listener;
/**
* The id list of the Acl.
*/
readonly aclIds: pulumi.Output<string[] | undefined>;
/**
* The enable status of Acl. Optional choice contains `on`, `off`.
*/
readonly aclStatus: pulumi.Output<string>;
/**
* The type of the Acl. Optional choice contains `white`, `black`.
*/
readonly aclType: pulumi.Output<string>;
/**
* The bandwidth of the Listener. Unit: Mbps. Default is -1, indicating that the Listener does not specify a speed limit.
*/
readonly bandwidth: pulumi.Output<number | undefined>;
/**
* The certificate id associated with the listener.
*/
readonly certificateId: pulumi.Output<string | undefined>;
/**
* Whether to enable connection drain of the Listener. Valid values: `off`, `on`. Default is `off`.
* This filed is valid only when the value of field `protocol` is `TCP` or `UDP`.
*/
readonly connectionDrainEnabled: pulumi.Output<string | undefined>;
/**
* The connection drain timeout of the Listener. Valid value range is `0-900`.
* This filed is required when the value of field `connectionDrainEnabled` is `on`.
*/
readonly connectionDrainTimeout: pulumi.Output<number>;
/**
* The name of the cookie for session persistence configured on the backend server. When PersistenceType is configured as `server`, this parameter is required. When PersistenceType is configured as any other value, this parameter is not effective.
*/
readonly cookie: pulumi.Output<string | undefined>;
/**
* The description of the Listener.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The enable status of the Listener. Optional choice contains `on`, `off`.
*/
readonly enabled: pulumi.Output<string>;
/**
* The connection timeout of the Listener.
*/
readonly establishedTimeout: pulumi.Output<number>;
/**
* The config of health check.
*/
readonly healthCheck: pulumi.Output<outputs.clb.ListenerHealthCheck>;
/**
* The ID of the Listener.
*/
readonly listenerId: pulumi.Output<string>;
/**
* The name of the Listener.
*/
readonly listenerName: pulumi.Output<string>;
/**
* The region of the request.
*/
readonly loadBalancerId: pulumi.Output<string>;
/**
* The persistence timeout of the Listener. Unit: second. Default is `1000`. When PersistenceType is configured as source_ip, the value range is 1-3600. When PersistenceType is configured as insert, the value range is 1-86400. This filed is valid only when the value of field `persistenceType` is `sourceIp` or `insert`.
*/
readonly persistenceTimeout: pulumi.Output<number | undefined>;
/**
* The persistence type of the Listener. Valid values: `off`, `sourceIp`, `insert`, `server`. Default is `off`.
* `sourceIp`: Represents the source IP address, only effective for TCP/UDP protocols. `insert`: means implanting a cookie, only effective for HTTP/HTTPS protocol and when the scheduler is `wrr`. `server`: Indicates rewriting cookies, only effective for HTTP/HTTPS protocols and when the scheduler is `wrr`.
*/
readonly persistenceType: pulumi.Output<string | undefined>;
/**
* The port receiving request of the Listener, the value range in 1~65535.
*/
readonly port: pulumi.Output<number>;
/**
* The protocol of the Listener. Optional choice contains `TCP`, `UDP`, `HTTP`, `HTTPS`.
*/
readonly protocol: pulumi.Output<string>;
/**
* Whether to enable proxy protocol. Valid values: `off`, `standard`. Default is `off`.
* This filed is valid only when the value of field `protocol` is `TCP` or `UDP`.
*/
readonly proxyProtocolType: pulumi.Output<string | undefined>;
/**
* The scheduling algorithm of the Listener. Optional choice contains `wrr`, `wlc`, `sh`.
*/
readonly scheduler: pulumi.Output<string>;
/**
* The server group id associated with the listener.
*/
readonly serverGroupId: pulumi.Output<string>;
/**
* Create a Listener resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ListenerArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Listener resources.
*/
export interface ListenerState {
/**
* The id list of the Acl.
*/
aclIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The enable status of Acl. Optional choice contains `on`, `off`.
*/
aclStatus?: pulumi.Input<string>;
/**
* The type of the Acl. Optional choice contains `white`, `black`.
*/
aclType?: pulumi.Input<string>;
/**
* The bandwidth of the Listener. Unit: Mbps. Default is -1, indicating that the Listener does not specify a speed limit.
*/
bandwidth?: pulumi.Input<number>;
/**
* The certificate id associated with the listener.
*/
certificateId?: pulumi.Input<string>;
/**
* Whether to enable connection drain of the Listener. Valid values: `off`, `on`. Default is `off`.
* This filed is valid only when the value of field `protocol` is `TCP` or `UDP`.
*/
connectionDrainEnabled?: pulumi.Input<string>;
/**
* The connection drain timeout of the Listener. Valid value range is `0-900`.
* This filed is required when the value of field `connectionDrainEnabled` is `on`.
*/
connectionDrainTimeout?: pulumi.Input<number>;
/**
* The name of the cookie for session persistence configured on the backend server. When PersistenceType is configured as `server`, this parameter is required. When PersistenceType is configured as any other value, this parameter is not effective.
*/
cookie?: pulumi.Input<string>;
/**
* The description of the Listener.
*/
description?: pulumi.Input<string>;
/**
* The enable status of the Listener. Optional choice contains `on`, `off`.
*/
enabled?: pulumi.Input<string>;
/**
* The connection timeout of the Listener.
*/
establishedTimeout?: pulumi.Input<number>;
/**
* The config of health check.
*/
healthCheck?: pulumi.Input<inputs.clb.ListenerHealthCheck>;
/**
* The ID of the Listener.
*/
listenerId?: pulumi.Input<string>;
/**
* The name of the Listener.
*/
listenerName?: pulumi.Input<string>;
/**
* The region of the request.
*/
loadBalancerId?: pulumi.Input<string>;
/**
* The persistence timeout of the Listener. Unit: second. Default is `1000`. When PersistenceType is configured as source_ip, the value range is 1-3600. When PersistenceType is configured as insert, the value range is 1-86400. This filed is valid only when the value of field `persistenceType` is `sourceIp` or `insert`.
*/
persistenceTimeout?: pulumi.Input<number>;
/**
* The persistence type of the Listener. Valid values: `off`, `sourceIp`, `insert`, `server`. Default is `off`.
* `sourceIp`: Represents the source IP address, only effective for TCP/UDP protocols. `insert`: means implanting a cookie, only effective for HTTP/HTTPS protocol and when the scheduler is `wrr`. `server`: Indicates rewriting cookies, only effective for HTTP/HTTPS protocols and when the scheduler is `wrr`.
*/
persistenceType?: pulumi.Input<string>;
/**
* The port receiving request of the Listener, the value range in 1~65535.
*/
port?: pulumi.Input<number>;
/**
* The protocol of the Listener. Optional choice contains `TCP`, `UDP`, `HTTP`, `HTTPS`.
*/
protocol?: pulumi.Input<string>;
/**
* Whether to enable proxy protocol. Valid values: `off`, `standard`. Default is `off`.
* This filed is valid only when the value of field `protocol` is `TCP` or `UDP`.
*/
proxyProtocolType?: pulumi.Input<string>;
/**
* The scheduling algorithm of the Listener. Optional choice contains `wrr`, `wlc`, `sh`.
*/
scheduler?: pulumi.Input<string>;
/**
* The server group id associated with the listener.
*/
serverGroupId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Listener resource.
*/
export interface ListenerArgs {
/**
* The id list of the Acl.
*/
aclIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The enable status of Acl. Optional choice contains `on`, `off`.
*/
aclStatus?: pulumi.Input<string>;
/**
* The type of the Acl. Optional choice contains `white`, `black`.
*/
aclType?: pulumi.Input<string>;
/**
* The bandwidth of the Listener. Unit: Mbps. Default is -1, indicating that the Listener does not specify a speed limit.
*/
bandwidth?: pulumi.Input<number>;
/**
* The certificate id associated with the listener.
*/
certificateId?: pulumi.Input<string>;
/**
* Whether to enable connection drain of the Listener. Valid values: `off`, `on`. Default is `off`.
* This filed is valid only when the value of field `protocol` is `TCP` or `UDP`.
*/
connectionDrainEnabled?: pulumi.Input<string>;
/**
* The connection drain timeout of the Listener. Valid value range is `0-900`.
* This filed is required when the value of field `connectionDrainEnabled` is `on`.
*/
connectionDrainTimeout?: pulumi.Input<number>;
/**
* The name of the cookie for session persistence configured on the backend server. When PersistenceType is configured as `server`, this parameter is required. When PersistenceType is configured as any other value, this parameter is not effective.
*/
cookie?: pulumi.Input<string>;
/**
* The description of the Listener.
*/
description?: pulumi.Input<string>;
/**
* The enable status of the Listener. Optional choice contains `on`, `off`.
*/
enabled?: pulumi.Input<string>;
/**
* The connection timeout of the Listener.
*/
establishedTimeout?: pulumi.Input<number>;
/**
* The config of health check.
*/
healthCheck?: pulumi.Input<inputs.clb.ListenerHealthCheck>;
/**
* The name of the Listener.
*/
listenerName?: pulumi.Input<string>;
/**
* The region of the request.
*/
loadBalancerId: pulumi.Input<string>;
/**
* The persistence timeout of the Listener. Unit: second. Default is `1000`. When PersistenceType is configured as source_ip, the value range is 1-3600. When PersistenceType is configured as insert, the value range is 1-86400. This filed is valid only when the value of field `persistenceType` is `sourceIp` or `insert`.
*/
persistenceTimeout?: pulumi.Input<number>;
/**
* The persistence type of the Listener. Valid values: `off`, `sourceIp`, `insert`, `server`. Default is `off`.
* `sourceIp`: Represents the source IP address, only effective for TCP/UDP protocols. `insert`: means implanting a cookie, only effective for HTTP/HTTPS protocol and when the scheduler is `wrr`. `server`: Indicates rewriting cookies, only effective for HTTP/HTTPS protocols and when the scheduler is `wrr`.
*/
persistenceType?: pulumi.Input<string>;
/**
* The port receiving request of the Listener, the value range in 1~65535.
*/
port: pulumi.Input<number>;
/**
* The protocol of the Listener. Optional choice contains `TCP`, `UDP`, `HTTP`, `HTTPS`.
*/
protocol: pulumi.Input<string>;
/**
* Whether to enable proxy protocol. Valid values: `off`, `standard`. Default is `off`.
* This filed is valid only when the value of field `protocol` is `TCP` or `UDP`.
*/
proxyProtocolType?: pulumi.Input<string>;
/**
* The scheduling algorithm of the Listener. Optional choice contains `wrr`, `wlc`, `sh`.
*/
scheduler?: pulumi.Input<string>;
/**
* The server group id associated with the listener.
*/
serverGroupId: pulumi.Input<string>;
}