AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
aws.alb.getListener
Explore with Pulumi AI
Note:
aws.alb.Listener
is 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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const config = new pulumi.Config();
const listenerArn = config.require("listenerArn");
const listener = aws.lb.getListener({
arn: listenerArn,
});
// get listener from load_balancer_arn and port
const selected = aws.lb.getLoadBalancer({
name: "default-public",
});
const selected443 = selected.then(selected => aws.lb.getListener({
loadBalancerArn: selected.arn,
port: 443,
}));
import pulumi
import pulumi_aws as aws
config = pulumi.Config()
listener_arn = config.require("listenerArn")
listener = aws.lb.get_listener(arn=listener_arn)
# get listener from load_balancer_arn and port
selected = aws.lb.get_load_balancer(name="default-public")
selected443 = aws.lb.get_listener(load_balancer_arn=selected.arn,
port=443)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
listenerArn := cfg.Require("listenerArn")
_, err := lb.LookupListener(ctx, &lb.LookupListenerArgs{
Arn: pulumi.StringRef(listenerArn),
}, nil)
if err != nil {
return err
}
// get listener from load_balancer_arn and port
selected, err := lb.LookupLoadBalancer(ctx, &lb.LookupLoadBalancerArgs{
Name: pulumi.StringRef("default-public"),
}, nil)
if err != nil {
return err
}
_, err = lb.LookupListener(ctx, &lb.LookupListenerArgs{
LoadBalancerArn: pulumi.StringRef(selected.Arn),
Port: pulumi.IntRef(443),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var listenerArn = config.Require("listenerArn");
var listener = Aws.LB.GetListener.Invoke(new()
{
Arn = listenerArn,
});
// get listener from load_balancer_arn and port
var selected = Aws.LB.GetLoadBalancer.Invoke(new()
{
Name = "default-public",
});
var selected443 = Aws.LB.GetListener.Invoke(new()
{
LoadBalancerArn = selected.Apply(getLoadBalancerResult => getLoadBalancerResult.Arn),
Port = 443,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lb.LbFunctions;
import com.pulumi.aws.lb.inputs.GetListenerArgs;
import com.pulumi.aws.lb.inputs.GetLoadBalancerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var listenerArn = config.get("listenerArn");
final var listener = LbFunctions.getListener(GetListenerArgs.builder()
.arn(listenerArn)
.build());
// get listener from load_balancer_arn and port
final var selected = LbFunctions.getLoadBalancer(GetLoadBalancerArgs.builder()
.name("default-public")
.build());
final var selected443 = LbFunctions.getListener(GetListenerArgs.builder()
.loadBalancerArn(selected.applyValue(getLoadBalancerResult -> getLoadBalancerResult.arn()))
.port(443)
.build());
}
}
configuration:
# get listener from listener arn
listenerArn:
type: string
variables:
listener:
fn::invoke:
Function: aws:lb:getListener
Arguments:
arn: ${listenerArn}
# get listener from load_balancer_arn and port
selected:
fn::invoke:
Function: aws:lb:getLoadBalancer
Arguments:
name: default-public
selected443:
fn::invoke:
Function: aws:lb:getListener
Arguments:
loadBalancerArn: ${selected.arn}
port: 443
Using getListener
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getListener(args: GetListenerArgs, opts?: InvokeOptions): Promise<GetListenerResult>
function getListenerOutput(args: GetListenerOutputArgs, opts?: InvokeOptions): Output<GetListenerResult>
def get_listener(arn: Optional[str] = None,
load_balancer_arn: Optional[str] = None,
port: Optional[int] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetListenerResult
def get_listener_output(arn: Optional[pulumi.Input[str]] = None,
load_balancer_arn: Optional[pulumi.Input[str]] = None,
port: Optional[pulumi.Input[int]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetListenerResult]
func LookupListener(ctx *Context, args *LookupListenerArgs, opts ...InvokeOption) (*LookupListenerResult, error)
func LookupListenerOutput(ctx *Context, args *LookupListenerOutputArgs, opts ...InvokeOption) LookupListenerResultOutput
> Note: This function is named LookupListener
in the Go SDK.
public static class GetListener
{
public static Task<GetListenerResult> InvokeAsync(GetListenerArgs args, InvokeOptions? opts = null)
public static Output<GetListenerResult> Invoke(GetListenerInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetListenerResult> getListener(GetListenerArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:alb/getListener:getListener
arguments:
# arguments dictionary
The following arguments are supported:
- Arn string
- ARN of the listener. Required if
load_balancer_arn
andport
is not set. - Load
Balancer stringArn - ARN of the load balancer. Required if
arn
is not set. - Port int
- Port of the listener. Required if
arn
is not set. - Dictionary<string, string>
- Arn string
- ARN of the listener. Required if
load_balancer_arn
andport
is not set. - Load
Balancer stringArn - ARN of the load balancer. Required if
arn
is not set. - Port int
- Port of the listener. Required if
arn
is not set. - map[string]string
- arn String
- ARN of the listener. Required if
load_balancer_arn
andport
is not set. - load
Balancer StringArn - ARN of the load balancer. Required if
arn
is not set. - port Integer
- Port of the listener. Required if
arn
is not set. - Map<String,String>
- arn string
- ARN of the listener. Required if
load_balancer_arn
andport
is not set. - load
Balancer stringArn - ARN of the load balancer. Required if
arn
is not set. - port number
- Port of the listener. Required if
arn
is not set. - {[key: string]: string}
- arn str
- ARN of the listener. Required if
load_balancer_arn
andport
is not set. - load_
balancer_ strarn - ARN of the load balancer. Required if
arn
is not set. - port int
- Port of the listener. Required if
arn
is not set. - Mapping[str, str]
- arn String
- ARN of the listener. Required if
load_balancer_arn
andport
is not set. - load
Balancer StringArn - ARN of the load balancer. Required if
arn
is not set. - port Number
- Port of the listener. Required if
arn
is not set. - Map<String>
getListener Result
The following output properties are available:
- Alpn
Policy string - 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 - Mutual
Authentications List<GetListener Mutual Authentication> - Port int
- Protocol string
- Ssl
Policy string - Dictionary<string, string>
- Alpn
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 - Mutual
Authentications []GetListener Mutual Authentication - Port int
- Protocol string
- Ssl
Policy string - map[string]string
- alpn
Policy String - 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 - mutual
Authentications List<GetListener Mutual Authentication> - port Integer
- protocol String
- ssl
Policy String - Map<String,String>
- alpn
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 - mutual
Authentications GetListener Mutual Authentication[] - port number
- protocol string
- ssl
Policy string - {[key: string]: string}
- alpn_
policy str - arn str
- certificate_
arn str - default_
actions Sequence[GetListener Default Action] - id str
- The provider-assigned unique ID for this managed resource.
- load_
balancer_ strarn - mutual_
authentications Sequence[GetListener Mutual Authentication] - port int
- protocol str
- ssl_
policy str - Mapping[str, str]
- alpn
Policy String - arn String
- certificate
Arn String - default
Actions List<Property Map> - id String
- The provider-assigned unique ID for this managed resource.
- load
Balancer StringArn - mutual
Authentications List<Property Map> - port Number
- protocol String
- ssl
Policy String - Map<String>
Supporting Types
GetListenerDefaultAction
- Authenticate
Cognitos List<GetListener Default Action Authenticate Cognito> - Authenticate
Oidcs List<GetListener Default Action Authenticate Oidc> - Fixed
Responses List<GetListener Default Action Fixed Response> - Forwards
List<Get
Listener Default Action Forward> - Order int
- Redirects
List<Get
Listener Default Action Redirect> - Target
Group stringArn - Type string
- Authenticate
Cognitos []GetListener Default Action Authenticate Cognito - Authenticate
Oidcs []GetListener Default Action Authenticate Oidc - Fixed
Responses []GetListener Default Action Fixed Response - Forwards
[]Get
Listener Default Action Forward - Order int
- Redirects
[]Get
Listener Default Action Redirect - Target
Group stringArn - Type string
- authenticate
Cognitos List<GetListener Default Action Authenticate Cognito> - authenticate
Oidcs List<GetListener Default Action Authenticate Oidc> - fixed
Responses List<GetListener Default Action Fixed Response> - forwards
List<Get
Listener Default Action Forward> - order Integer
- redirects
List<Get
Listener Default Action Redirect> - target
Group StringArn - type String
- authenticate
Cognitos GetListener Default Action Authenticate Cognito[] - authenticate
Oidcs GetListener Default Action Authenticate Oidc[] - fixed
Responses GetListener Default Action Fixed Response[] - forwards
Get
Listener Default Action Forward[] - order number
- redirects
Get
Listener Default Action Redirect[] - target
Group stringArn - type string
- authenticate_
cognitos Sequence[GetListener Default Action Authenticate Cognito] - authenticate_
oidcs Sequence[GetListener Default Action Authenticate Oidc] - fixed_
responses Sequence[GetListener Default Action Fixed Response] - forwards
Sequence[Get
Listener Default Action Forward] - order int
- redirects
Sequence[Get
Listener Default Action Redirect] - target_
group_ strarn - type str
GetListenerDefaultActionAuthenticateCognito
- Authentication
Request Dictionary<string, string>Extra Params - On
Unauthenticated stringRequest - Scope string
- string
- Session
Timeout int - User
Pool stringArn - User
Pool stringClient Id - User
Pool stringDomain
- Authentication
Request map[string]stringExtra Params - On
Unauthenticated stringRequest - Scope string
- string
- Session
Timeout int - User
Pool stringArn - User
Pool stringClient Id - User
Pool stringDomain
- authentication
Request Map<String,String>Extra Params - on
Unauthenticated StringRequest - scope String
- String
- session
Timeout Integer - user
Pool StringArn - user
Pool StringClient Id - user
Pool StringDomain
- authentication
Request {[key: string]: string}Extra Params - on
Unauthenticated stringRequest - scope string
- string
- session
Timeout number - user
Pool stringArn - user
Pool stringClient Id - user
Pool stringDomain
- authentication_
request_ Mapping[str, str]extra_ params - on_
unauthenticated_ strrequest - scope str
- str
- session_
timeout int - user_
pool_ strarn - user_
pool_ strclient_ id - user_
pool_ strdomain
- authentication
Request Map<String>Extra Params - on
Unauthenticated StringRequest - scope String
- String
- session
Timeout Number - user
Pool StringArn - user
Pool StringClient Id - user
Pool StringDomain
GetListenerDefaultActionAuthenticateOidc
- Authentication
Request Dictionary<string, string>Extra Params - string
- Client
Id string - Client
Secret string - Issuer string
- On
Unauthenticated stringRequest - Scope string
- string
- Session
Timeout int - Token
Endpoint string - User
Info stringEndpoint
- Authentication
Request map[string]stringExtra Params - string
- Client
Id string - Client
Secret string - Issuer string
- On
Unauthenticated stringRequest - Scope string
- string
- Session
Timeout int - Token
Endpoint string - User
Info stringEndpoint
- authentication
Request Map<String,String>Extra Params - String
- client
Id String - client
Secret String - issuer String
- on
Unauthenticated StringRequest - scope String
- String
- session
Timeout Integer - token
Endpoint String - user
Info StringEndpoint
- authentication
Request {[key: string]: string}Extra Params - string
- client
Id string - client
Secret string - issuer string
- on
Unauthenticated stringRequest - scope string
- string
- session
Timeout number - token
Endpoint string - user
Info stringEndpoint
- authentication_
request_ Mapping[str, str]extra_ params - str
- client_
id str - client_
secret str - issuer str
- on_
unauthenticated_ strrequest - scope str
- str
- session_
timeout int - token_
endpoint str - user_
info_ strendpoint
- authentication
Request Map<String>Extra Params - String
- client
Id String - client
Secret String - issuer String
- on
Unauthenticated StringRequest - scope String
- String
- session
Timeout Number - token
Endpoint String - user
Info StringEndpoint
GetListenerDefaultActionFixedResponse
- Content
Type string - Message
Body string - Status
Code string
- Content
Type string - Message
Body string - Status
Code string
- content
Type String - message
Body String - status
Code String
- content
Type string - message
Body string - status
Code string
- content_
type str - message_
body str - status_
code str
- content
Type String - message
Body String - status
Code String
GetListenerDefaultActionForward
GetListenerDefaultActionForwardStickiness
GetListenerDefaultActionForwardTargetGroup
GetListenerDefaultActionRedirect
GetListenerMutualAuthentication
- Ignore
Client boolCertificate Expiry - Mode string
- Trust
Store stringArn
- Ignore
Client boolCertificate Expiry - Mode string
- Trust
Store stringArn
- ignore
Client BooleanCertificate Expiry - mode String
- trust
Store StringArn
- ignore
Client booleanCertificate Expiry - mode string
- trust
Store stringArn
- ignore_
client_ boolcertificate_ expiry - mode str
- trust_
store_ strarn
- ignore
Client BooleanCertificate Expiry - mode String
- trust
Store StringArn
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.