1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. gwlb
  5. Listener
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.gwlb.Listener

Explore with Pulumi AI

Provides a GWLB Listener resource.

For information about GWLB Listener and how to use it, see What is Listener.

NOTE: Available since v1.234.0.

Create Listener Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Listener(name: string, args: ListenerArgs, opts?: CustomResourceOptions);
@overload
def Listener(resource_name: str,
             args: ListenerArgs,
             opts: Optional[ResourceOptions] = None)

@overload
def Listener(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             load_balancer_id: Optional[str] = None,
             server_group_id: Optional[str] = None,
             dry_run: Optional[bool] = None,
             listener_description: Optional[str] = None,
             tags: Optional[Mapping[str, str]] = None)
func NewListener(ctx *Context, name string, args ListenerArgs, opts ...ResourceOption) (*Listener, error)
public Listener(string name, ListenerArgs args, CustomResourceOptions? opts = null)
public Listener(String name, ListenerArgs args)
public Listener(String name, ListenerArgs args, CustomResourceOptions options)
type: alicloud:gwlb:Listener
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ListenerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ListenerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ListenerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ListenerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ListenerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var examplelistenerResourceResourceFromGwlblistener = new AliCloud.Gwlb.Listener("examplelistenerResourceResourceFromGwlblistener", new()
{
    LoadBalancerId = "string",
    ServerGroupId = "string",
    DryRun = false,
    ListenerDescription = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := gwlb.NewListener(ctx, "examplelistenerResourceResourceFromGwlblistener", &gwlb.ListenerArgs{
	LoadBalancerId:      pulumi.String("string"),
	ServerGroupId:       pulumi.String("string"),
	DryRun:              pulumi.Bool(false),
	ListenerDescription: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var examplelistenerResourceResourceFromGwlblistener = new Listener("examplelistenerResourceResourceFromGwlblistener", ListenerArgs.builder()
    .loadBalancerId("string")
    .serverGroupId("string")
    .dryRun(false)
    .listenerDescription("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
examplelistener_resource_resource_from_gwlblistener = alicloud.gwlb.Listener("examplelistenerResourceResourceFromGwlblistener",
    load_balancer_id="string",
    server_group_id="string",
    dry_run=False,
    listener_description="string",
    tags={
        "string": "string",
    })
Copy
const examplelistenerResourceResourceFromGwlblistener = new alicloud.gwlb.Listener("examplelistenerResourceResourceFromGwlblistener", {
    loadBalancerId: "string",
    serverGroupId: "string",
    dryRun: false,
    listenerDescription: "string",
    tags: {
        string: "string",
    },
});
Copy
type: alicloud:gwlb:Listener
properties:
    dryRun: false
    listenerDescription: string
    loadBalancerId: string
    serverGroupId: string
    tags:
        string: string
Copy

Listener Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Listener resource accepts the following input properties:

LoadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
The GWLB instance ID.
ServerGroupId This property is required. string
The server group ID.
DryRun bool
Specifies whether to perform a dry run, without performing the actual request. Valid values:
ListenerDescription string

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

Tags Dictionary<string, string>
The tags. You can specify at most 20 tags in each call.
LoadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
The GWLB instance ID.
ServerGroupId This property is required. string
The server group ID.
DryRun bool
Specifies whether to perform a dry run, without performing the actual request. Valid values:
ListenerDescription string

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

Tags map[string]string
The tags. You can specify at most 20 tags in each call.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
String
The GWLB instance ID.
serverGroupId This property is required. String
The server group ID.
dryRun Boolean
Specifies whether to perform a dry run, without performing the actual request. Valid values:
listenerDescription String

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

tags Map<String,String>
The tags. You can specify at most 20 tags in each call.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
string
The GWLB instance ID.
serverGroupId This property is required. string
The server group ID.
dryRun boolean
Specifies whether to perform a dry run, without performing the actual request. Valid values:
listenerDescription string

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

tags {[key: string]: string}
The tags. You can specify at most 20 tags in each call.
load_balancer_id
This property is required.
Changes to this property will trigger replacement.
str
The GWLB instance ID.
server_group_id This property is required. str
The server group ID.
dry_run bool
Specifies whether to perform a dry run, without performing the actual request. Valid values:
listener_description str

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

tags Mapping[str, str]
The tags. You can specify at most 20 tags in each call.
loadBalancerId
This property is required.
Changes to this property will trigger replacement.
String
The GWLB instance ID.
serverGroupId This property is required. String
The server group ID.
dryRun Boolean
Specifies whether to perform a dry run, without performing the actual request. Valid values:
listenerDescription String

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

tags Map<String>
The tags. You can specify at most 20 tags in each call.

Outputs

All input properties are implicitly available as output properties. Additionally, the Listener resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
RegionId string
The region ID.
Status string
The status of the listener.
Id string
The provider-assigned unique ID for this managed resource.
RegionId string
The region ID.
Status string
The status of the listener.
id String
The provider-assigned unique ID for this managed resource.
regionId String
The region ID.
status String
The status of the listener.
id string
The provider-assigned unique ID for this managed resource.
regionId string
The region ID.
status string
The status of the listener.
id str
The provider-assigned unique ID for this managed resource.
region_id str
The region ID.
status str
The status of the listener.
id String
The provider-assigned unique ID for this managed resource.
regionId String
The region ID.
status String
The status of the listener.

Look up Existing Listener Resource

Get an existing Listener 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?: ListenerState, opts?: CustomResourceOptions): Listener
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        dry_run: Optional[bool] = None,
        listener_description: Optional[str] = None,
        load_balancer_id: Optional[str] = None,
        region_id: Optional[str] = None,
        server_group_id: Optional[str] = None,
        status: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None) -> Listener
func GetListener(ctx *Context, name string, id IDInput, state *ListenerState, opts ...ResourceOption) (*Listener, error)
public static Listener Get(string name, Input<string> id, ListenerState? state, CustomResourceOptions? opts = null)
public static Listener get(String name, Output<String> id, ListenerState state, CustomResourceOptions options)
resources:  _:    type: alicloud:gwlb:Listener    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DryRun bool
Specifies whether to perform a dry run, without performing the actual request. Valid values:
ListenerDescription string

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

LoadBalancerId Changes to this property will trigger replacement. string
The GWLB instance ID.
RegionId string
The region ID.
ServerGroupId string
The server group ID.
Status string
The status of the listener.
Tags Dictionary<string, string>
The tags. You can specify at most 20 tags in each call.
DryRun bool
Specifies whether to perform a dry run, without performing the actual request. Valid values:
ListenerDescription string

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

LoadBalancerId Changes to this property will trigger replacement. string
The GWLB instance ID.
RegionId string
The region ID.
ServerGroupId string
The server group ID.
Status string
The status of the listener.
Tags map[string]string
The tags. You can specify at most 20 tags in each call.
dryRun Boolean
Specifies whether to perform a dry run, without performing the actual request. Valid values:
listenerDescription String

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

loadBalancerId Changes to this property will trigger replacement. String
The GWLB instance ID.
regionId String
The region ID.
serverGroupId String
The server group ID.
status String
The status of the listener.
tags Map<String,String>
The tags. You can specify at most 20 tags in each call.
dryRun boolean
Specifies whether to perform a dry run, without performing the actual request. Valid values:
listenerDescription string

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

loadBalancerId Changes to this property will trigger replacement. string
The GWLB instance ID.
regionId string
The region ID.
serverGroupId string
The server group ID.
status string
The status of the listener.
tags {[key: string]: string}
The tags. You can specify at most 20 tags in each call.
dry_run bool
Specifies whether to perform a dry run, without performing the actual request. Valid values:
listener_description str

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

load_balancer_id Changes to this property will trigger replacement. str
The GWLB instance ID.
region_id str
The region ID.
server_group_id str
The server group ID.
status str
The status of the listener.
tags Mapping[str, str]
The tags. You can specify at most 20 tags in each call.
dryRun Boolean
Specifies whether to perform a dry run, without performing the actual request. Valid values:
listenerDescription String

The description of the listener.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

loadBalancerId Changes to this property will trigger replacement. String
The GWLB instance ID.
regionId String
The region ID.
serverGroupId String
The server group ID.
status String
The status of the listener.
tags Map<String>
The tags. You can specify at most 20 tags in each call.

Import

GWLB Listener can be imported using the id, e.g.

$ pulumi import alicloud:gwlb/listener:Listener example <id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.