GetListener
Note:
aws.alb.Listeneris known asaws.lb.Listener. The functionality is identical.
Provides information about a Load Balancer Listener.
This data source can prove useful when a module accepts an LB Listener as an input variable and needs to know the LB it is attached to, or other information specific to the listener in question.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var listenerArn = config.RequireObject<dynamic>("listenerArn");
var listener = Output.Create(Aws.LB.GetListener.InvokeAsync(new Aws.LB.GetListenerArgs
{
Arn = listenerArn,
}));
var selected = Output.Create(Aws.LB.GetLoadBalancer.InvokeAsync(new Aws.LB.GetLoadBalancerArgs
{
Name = "default-public",
}));
var selected443 = selected.Apply(selected => Output.Create(Aws.LB.GetListener.InvokeAsync(new Aws.LB.GetListenerArgs
{
LoadBalancerArn = selected.Arn,
Port = 443,
})));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/lb"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
opt0 := listenerArn
_, err := lb.LookupListener(ctx, &lb.LookupListenerArgs{
Arn: &opt0,
}, nil)
if err != nil {
return err
}
opt1 := "default-public"
selected, err := lb.LookupLoadBalancer(ctx, &lb.LookupLoadBalancerArgs{
Name: &opt1,
}, nil)
if err != nil {
return err
}
opt2 := selected.Arn
opt3 := 443
_, err = lb.LookupListener(ctx, &lb.LookupListenerArgs{
LoadBalancerArn: &opt2,
Port: &opt3,
}, nil)
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
config = pulumi.Config()
listener_arn = config.require_object("listenerArn")
listener = aws.lb.get_listener(arn=listener_arn)
selected = aws.lb.get_load_balancer(name="default-public")
selected443 = aws.lb.get_listener(load_balancer_arn=selected.arn,
port=443)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const config = new pulumi.Config();
const listenerArn = config.require("listenerArn");
const listener = pulumi.output(aws.lb.getListener({
arn: listenerArn,
}, { async: true }));
const selected = pulumi.output(aws.lb.getLoadBalancer({
name: "default-public",
}, { async: true }));
const selected443 = selected.apply(selected => aws.lb.getListener({
loadBalancerArn: selected.arn!,
port: 443,
}, { async: true }));Deprecated: aws.applicationloadbalancing.getListener has been deprecated in favor of aws.alb.getListener
Using GetListener
function getListener(args: GetListenerArgs, opts?: InvokeOptions): Promise<GetListenerResult>function get_listener(arn=None, load_balancer_arn=None, port=None, opts=None)func LookupListener(ctx *Context, args *LookupListenerArgs, opts ...InvokeOption) (*LookupListenerResult, error)Note: This function is named
LookupListenerin the Go SDK.
public static class GetListener {
public static Task<GetListenerResult> InvokeAsync(GetListenerArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
GetListener Result
The following output properties are available:
- Arn string
- Certificate
Arn string - Default
Actions List<GetListener Default Action> - Id string
The provider-assigned unique ID for this managed resource.
- Load
Balancer stringArn - Port int
- Protocol string
- Ssl
Policy string
- Arn string
- Certificate
Arn string - Default
Actions []GetListener Default Action - Id string
The provider-assigned unique ID for this managed resource.
- Load
Balancer stringArn - Port int
- Protocol string
- Ssl
Policy string
- arn string
- certificate
Arn string - default
Actions GetListener Default Action[] - id string
The provider-assigned unique ID for this managed resource.
- load
Balancer stringArn - port number
- protocol string
- ssl
Policy string
- arn str
- certificate_
arn str - default_
actions List[GetListener Default Action] - id str
The provider-assigned unique ID for this managed resource.
- load_
balancer_ strarn - port float
- protocol str
- ssl_
policy str
Supporting Types
GetListenerDefaultAction
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetListenerDefaultActionAuthenticateCognito
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetListenerDefaultActionAuthenticateOidc
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetListenerDefaultActionFixedResponse
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetListenerDefaultActionRedirect
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.