1. Registry
  2. Packages
  3. AWS
  4. API Docs
  5. vpclattice
  6. getListener
Viewing docs for AWS v7.43.0
published on Thursday, Aug 20, 2026 by Pulumi
aws logo aws logo
Viewing docs for AWS v7.43.0
published on Thursday, Aug 20, 2026 by Pulumi

    Data source for managing an AWS VPC Lattice Listener.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.vpclattice.getListener({});
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.vpclattice.get_listener()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/vpclattice"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vpclattice.LookupListener(ctx, &vpclattice.LookupListenerArgs{}, 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 example = Aws.VpcLattice.GetListener.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.vpclattice.VpclatticeFunctions;
    import com.pulumi.aws.vpclattice.inputs.GetListenerArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 example = VpclatticeFunctions.getListener(GetListenerArgs.builder()
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: aws:vpclattice:getListener
          arguments: {}
    
    pulumi {
      required_providers {
        aws = {
          source = "pulumi/aws"
        }
      }
    }
    
    data "aws_vpclattice_getlistener" "example" {
    }
    

    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?: InvokeOutputOptions): Output<GetListenerResult>
    def get_listener(listener_identifier: Optional[str] = None,
                     region: Optional[str] = None,
                     service_identifier: Optional[str] = None,
                     tags: Optional[Mapping[str, str]] = None,
                     opts: Optional[InvokeOptions] = None) -> GetListenerResult
    def get_listener_output(listener_identifier: pulumi.Input[Optional[str]] = None,
                     region: pulumi.Input[Optional[str]] = None,
                     service_identifier: pulumi.Input[Optional[str]] = None,
                     tags: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
                     opts: Optional[InvokeOutputOptions] = 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 Output<GetListenerResult> Invoke(GetListenerInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetListenerResult> getListener(GetListenerArgs args, InvokeOptions options)
    public static Output<GetListenerResult> getListener(GetListenerArgs args, InvokeOptions options)
    public static Output<GetListenerResult> getListener(GetListenerArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: aws:vpclattice/getListener:getListener
      arguments:
        # arguments dictionary
    data "aws_vpclattice_get_listener" "name" {
        # arguments
    }

    The following arguments are supported:

    ListenerIdentifier string
    ID or Amazon Resource Name (ARN) of the listener
    ServiceIdentifier string
    ID or Amazon Resource Name (ARN) of the service network
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags Dictionary<string, string>
    List of tags associated with the listener.
    ListenerIdentifier string
    ID or Amazon Resource Name (ARN) of the listener
    ServiceIdentifier string
    ID or Amazon Resource Name (ARN) of the service network
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags map[string]string
    List of tags associated with the listener.
    listener_identifier string
    ID or Amazon Resource Name (ARN) of the listener
    service_identifier string
    ID or Amazon Resource Name (ARN) of the service network
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags map(string)
    List of tags associated with the listener.
    listenerIdentifier String
    ID or Amazon Resource Name (ARN) of the listener
    serviceIdentifier String
    ID or Amazon Resource Name (ARN) of the service network
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String,String>
    List of tags associated with the listener.
    listenerIdentifier string
    ID or Amazon Resource Name (ARN) of the listener
    serviceIdentifier string
    ID or Amazon Resource Name (ARN) of the service network
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags {[key: string]: string}
    List of tags associated with the listener.
    listener_identifier str
    ID or Amazon Resource Name (ARN) of the listener
    service_identifier str
    ID or Amazon Resource Name (ARN) of the service network
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Mapping[str, str]
    List of tags associated with the listener.
    listenerIdentifier String
    ID or Amazon Resource Name (ARN) of the listener
    serviceIdentifier String
    ID or Amazon Resource Name (ARN) of the service network
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String>
    List of tags associated with the listener.

    getListener Result

    The following output properties are available:

    Arn string
    ARN of the listener.
    CreatedAt string
    Date and time that the listener was created.
    DefaultActions List<GetListenerDefaultAction>
    Action for the default listener rule. See defaultAction Block below.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedAt string
    Date and time the listener was last updated.
    ListenerId string
    ID of the listener.
    ListenerIdentifier string
    Name string
    Name of the listener.
    Port int
    Listener port.
    Protocol string
    Listener protocol. Either HTTPS or HTTP.
    Region string
    ServiceArn string
    ARN of the service.
    ServiceId string
    ID of the service.
    ServiceIdentifier string
    Tags Dictionary<string, string>
    List of tags associated with the listener.
    Arn string
    ARN of the listener.
    CreatedAt string
    Date and time that the listener was created.
    DefaultActions []GetListenerDefaultAction
    Action for the default listener rule. See defaultAction Block below.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedAt string
    Date and time the listener was last updated.
    ListenerId string
    ID of the listener.
    ListenerIdentifier string
    Name string
    Name of the listener.
    Port int
    Listener port.
    Protocol string
    Listener protocol. Either HTTPS or HTTP.
    Region string
    ServiceArn string
    ARN of the service.
    ServiceId string
    ID of the service.
    ServiceIdentifier string
    Tags map[string]string
    List of tags associated with the listener.
    arn string
    ARN of the listener.
    created_at string
    Date and time that the listener was created.
    default_actions list(object)
    Action for the default listener rule. See defaultAction Block below.
    id string
    The provider-assigned unique ID for this managed resource.
    last_updated_at string
    Date and time the listener was last updated.
    listener_id string
    ID of the listener.
    listener_identifier string
    name string
    Name of the listener.
    port number
    Listener port.
    protocol string
    Listener protocol. Either HTTPS or HTTP.
    region string
    service_arn string
    ARN of the service.
    service_id string
    ID of the service.
    service_identifier string
    tags map(string)
    List of tags associated with the listener.
    arn String
    ARN of the listener.
    createdAt String
    Date and time that the listener was created.
    defaultActions List<GetListenerDefaultAction>
    Action for the default listener rule. See defaultAction Block below.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt String
    Date and time the listener was last updated.
    listenerId String
    ID of the listener.
    listenerIdentifier String
    name String
    Name of the listener.
    port Integer
    Listener port.
    protocol String
    Listener protocol. Either HTTPS or HTTP.
    region String
    serviceArn String
    ARN of the service.
    serviceId String
    ID of the service.
    serviceIdentifier String
    tags Map<String,String>
    List of tags associated with the listener.
    arn string
    ARN of the listener.
    createdAt string
    Date and time that the listener was created.
    defaultActions GetListenerDefaultAction[]
    Action for the default listener rule. See defaultAction Block below.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt string
    Date and time the listener was last updated.
    listenerId string
    ID of the listener.
    listenerIdentifier string
    name string
    Name of the listener.
    port number
    Listener port.
    protocol string
    Listener protocol. Either HTTPS or HTTP.
    region string
    serviceArn string
    ARN of the service.
    serviceId string
    ID of the service.
    serviceIdentifier string
    tags {[key: string]: string}
    List of tags associated with the listener.
    arn str
    ARN of the listener.
    created_at str
    Date and time that the listener was created.
    default_actions Sequence[GetListenerDefaultAction]
    Action for the default listener rule. See defaultAction Block below.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated_at str
    Date and time the listener was last updated.
    listener_id str
    ID of the listener.
    listener_identifier str
    name str
    Name of the listener.
    port int
    Listener port.
    protocol str
    Listener protocol. Either HTTPS or HTTP.
    region str
    service_arn str
    ARN of the service.
    service_id str
    ID of the service.
    service_identifier str
    tags Mapping[str, str]
    List of tags associated with the listener.
    arn String
    ARN of the listener.
    createdAt String
    Date and time that the listener was created.
    defaultActions List<Property Map>
    Action for the default listener rule. See defaultAction Block below.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt String
    Date and time the listener was last updated.
    listenerId String
    ID of the listener.
    listenerIdentifier String
    name String
    Name of the listener.
    port Number
    Listener port.
    protocol String
    Listener protocol. Either HTTPS or HTTP.
    region String
    serviceArn String
    ARN of the service.
    serviceId String
    ID of the service.
    serviceIdentifier String
    tags Map<String>
    List of tags associated with the listener.

    Supporting Types

    GetListenerDefaultAction

    FixedResponses List<GetListenerDefaultActionFixedResponse>
    Fixed response action. See fixedResponse Block below.
    Forwards List<GetListenerDefaultActionForward>
    Forward action. See forward Block below.
    FixedResponses []GetListenerDefaultActionFixedResponse
    Fixed response action. See fixedResponse Block below.
    Forwards []GetListenerDefaultActionForward
    Forward action. See forward Block below.
    fixed_responses list(object)
    Fixed response action. See fixedResponse Block below.
    forwards list(object)
    Forward action. See forward Block below.
    fixedResponses List<GetListenerDefaultActionFixedResponse>
    Fixed response action. See fixedResponse Block below.
    forwards List<GetListenerDefaultActionForward>
    Forward action. See forward Block below.
    fixedResponses GetListenerDefaultActionFixedResponse[]
    Fixed response action. See fixedResponse Block below.
    forwards GetListenerDefaultActionForward[]
    Forward action. See forward Block below.
    fixed_responses Sequence[GetListenerDefaultActionFixedResponse]
    Fixed response action. See fixedResponse Block below.
    forwards Sequence[GetListenerDefaultActionForward]
    Forward action. See forward Block below.
    fixedResponses List<Property Map>
    Fixed response action. See fixedResponse Block below.
    forwards List<Property Map>
    Forward action. See forward Block below.

    GetListenerDefaultActionFixedResponse

    StatusCode int
    Custom HTTP status code to return.
    StatusCode int
    Custom HTTP status code to return.
    status_code number
    Custom HTTP status code to return.
    statusCode Integer
    Custom HTTP status code to return.
    statusCode number
    Custom HTTP status code to return.
    status_code int
    Custom HTTP status code to return.
    statusCode Number
    Custom HTTP status code to return.

    GetListenerDefaultActionForward

    TargetGroups List<GetListenerDefaultActionForwardTargetGroup>
    Target groups that the listener forwards traffic to. See targetGroups Block below.
    TargetGroups []GetListenerDefaultActionForwardTargetGroup
    Target groups that the listener forwards traffic to. See targetGroups Block below.
    target_groups list(object)
    Target groups that the listener forwards traffic to. See targetGroups Block below.
    targetGroups List<GetListenerDefaultActionForwardTargetGroup>
    Target groups that the listener forwards traffic to. See targetGroups Block below.
    targetGroups GetListenerDefaultActionForwardTargetGroup[]
    Target groups that the listener forwards traffic to. See targetGroups Block below.
    target_groups Sequence[GetListenerDefaultActionForwardTargetGroup]
    Target groups that the listener forwards traffic to. See targetGroups Block below.
    targetGroups List<Property Map>
    Target groups that the listener forwards traffic to. See targetGroups Block below.

    GetListenerDefaultActionForwardTargetGroup

    TargetGroupIdentifier string
    ID or ARN of the target group.
    Weight int
    Weight assigned to the target group that determines the proportion of traffic it receives.
    TargetGroupIdentifier string
    ID or ARN of the target group.
    Weight int
    Weight assigned to the target group that determines the proportion of traffic it receives.
    target_group_identifier string
    ID or ARN of the target group.
    weight number
    Weight assigned to the target group that determines the proportion of traffic it receives.
    targetGroupIdentifier String
    ID or ARN of the target group.
    weight Integer
    Weight assigned to the target group that determines the proportion of traffic it receives.
    targetGroupIdentifier string
    ID or ARN of the target group.
    weight number
    Weight assigned to the target group that determines the proportion of traffic it receives.
    target_group_identifier str
    ID or ARN of the target group.
    weight int
    Weight assigned to the target group that determines the proportion of traffic it receives.
    targetGroupIdentifier String
    ID or ARN of the target group.
    weight Number
    Weight assigned to the target group that determines the proportion of traffic it receives.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo aws logo
    Viewing docs for AWS v7.43.0
    published on Thursday, Aug 20, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial