GetListener

Note: aws.alb.Listener is known as aws.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 LookupListener in the Go SDK.

public static class GetListener {
    public static Task<GetListenerResult> InvokeAsync(GetListenerArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Arn string

The arn of the listener. Required if load_balancer_arn and port is not set.

LoadBalancerArn string

The arn of the load balancer. Required if arn is not set.

Port int

The port of the listener. Required if arn is not set.

Arn string

The arn of the listener. Required if load_balancer_arn and port is not set.

LoadBalancerArn string

The arn of the load balancer. Required if arn is not set.

Port int

The port of the listener. Required if arn is not set.

arn string

The arn of the listener. Required if load_balancer_arn and port is not set.

loadBalancerArn string

The arn of the load balancer. Required if arn is not set.

port number

The port of the listener. Required if arn is not set.

arn str

The arn of the listener. Required if load_balancer_arn and port is not set.

load_balancer_arn str

The arn of the load balancer. Required if arn is not set.

port float

The port of the listener. Required if arn is not set.

GetListener Result

The following output properties are available:

Arn string
CertificateArn string
DefaultActions List<GetListenerDefaultAction>
Id string

The provider-assigned unique ID for this managed resource.

LoadBalancerArn string
Port int
Protocol string
SslPolicy string
Arn string
CertificateArn string
DefaultActions []GetListenerDefaultAction
Id string

The provider-assigned unique ID for this managed resource.

LoadBalancerArn string
Port int
Protocol string
SslPolicy string
arn string
certificateArn string
defaultActions GetListenerDefaultAction[]
id string

The provider-assigned unique ID for this managed resource.

loadBalancerArn string
port number
protocol string
sslPolicy string
arn str
certificate_arn str
default_actions List[GetListenerDefaultAction]
id str

The provider-assigned unique ID for this managed resource.

load_balancer_arn str
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.

AuthenticateCognitos List<GetListenerDefaultActionAuthenticateCognitoArgs>
AuthenticateOidcs List<GetListenerDefaultActionAuthenticateOidcArgs>
FixedResponses List<GetListenerDefaultActionFixedResponseArgs>
Order int
Redirects List<GetListenerDefaultActionRedirectArgs>
TargetGroupArn string
Type string
AuthenticateCognitos []GetListenerDefaultActionAuthenticateCognito
AuthenticateOidcs []GetListenerDefaultActionAuthenticateOidc
FixedResponses []GetListenerDefaultActionFixedResponse
Order int
Redirects []GetListenerDefaultActionRedirect
TargetGroupArn string
Type string
authenticateCognitos GetListenerDefaultActionAuthenticateCognito[]
authenticateOidcs GetListenerDefaultActionAuthenticateOidc[]
fixedResponses GetListenerDefaultActionFixedResponse[]
order number
redirects GetListenerDefaultActionRedirect[]
targetGroupArn string
type string
authenticateCognitos List[GetListenerDefaultActionAuthenticateCognito]
authenticateOidcs List[GetListenerDefaultActionAuthenticateOidc]
fixedResponses List[GetListenerDefaultActionFixedResponse]
order float
redirects List[GetListenerDefaultActionRedirect]
target_group_arn str
type str

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.

AuthenticationRequestExtraParams Dictionary<string, string>
OnUnauthenticatedRequest string
Scope string
SessionCookieName string
SessionTimeout int
UserPoolArn string
UserPoolClientId string
UserPoolDomain string
AuthenticationRequestExtraParams map[string]string
OnUnauthenticatedRequest string
Scope string
SessionCookieName string
SessionTimeout int
UserPoolArn string
UserPoolClientId string
UserPoolDomain string
authenticationRequestExtraParams {[key: string]: string}
onUnauthenticatedRequest string
scope string
sessionCookieName string
sessionTimeout number
userPoolArn string
userPoolClientId string
userPoolDomain string
authenticationRequestExtraParams Dict[str, str]
onUnauthenticatedRequest str
scope str
sessionCookieName str
sessionTimeout float
userPoolArn str
userPoolClientId str
userPoolDomain str

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.

AuthenticationRequestExtraParams Dictionary<string, string>
AuthorizationEndpoint string
ClientId string
ClientSecret string
Issuer string
OnUnauthenticatedRequest string
Scope string
SessionCookieName string
SessionTimeout int
TokenEndpoint string
UserInfoEndpoint string
AuthenticationRequestExtraParams map[string]string
AuthorizationEndpoint string
ClientId string
ClientSecret string
Issuer string
OnUnauthenticatedRequest string
Scope string
SessionCookieName string
SessionTimeout int
TokenEndpoint string
UserInfoEndpoint string
authenticationRequestExtraParams {[key: string]: string}
authorizationEndpoint string
clientId string
clientSecret string
issuer string
onUnauthenticatedRequest string
scope string
sessionCookieName string
sessionTimeout number
tokenEndpoint string
userInfoEndpoint string
authenticationRequestExtraParams Dict[str, str]
authorizationEndpoint str
client_id str
client_secret str
issuer str
onUnauthenticatedRequest str
scope str
sessionCookieName str
sessionTimeout float
tokenEndpoint str
userInfoEndpoint str

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.

ContentType string
MessageBody string
StatusCode string
ContentType string
MessageBody string
StatusCode string
contentType string
messageBody string
statusCode string
content_type str
messageBody str
status_code str

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.

Host string
Path string
Port string

The port of the listener. Required if arn is not set.

Protocol string
Query string
StatusCode string
Host string
Path string
Port string

The port of the listener. Required if arn is not set.

Protocol string
Query string
StatusCode string
host string
path string
port string

The port of the listener. Required if arn is not set.

protocol string
query string
statusCode string
host str
path str
port str

The port of the listener. Required if arn is not set.

protocol str
query str
status_code str

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.