Listener

Provides a Load Balancer Listener resource.

Note: aws.alb.Listener is known as aws.lb.Listener. The functionality is identical.

Example Usage

Forward Action

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var frontEndLoadBalancer = new Aws.LB.LoadBalancer("frontEndLoadBalancer", new Aws.LB.LoadBalancerArgs
        {
        });
        var frontEndTargetGroup = new Aws.LB.TargetGroup("frontEndTargetGroup", new Aws.LB.TargetGroupArgs
        {
        });
        var frontEndListener = new Aws.LB.Listener("frontEndListener", new Aws.LB.ListenerArgs
        {
            CertificateArn = "arn:aws:iam::187416307283:server-certificate/test_cert_rab3wuqwgja25ct3n4jdj2tzu4",
            DefaultActions = 
            {
                new Aws.LB.Inputs.ListenerDefaultActionArgs
                {
                    TargetGroupArn = frontEndTargetGroup.Arn,
                    Type = "forward",
                },
            },
            LoadBalancerArn = frontEndLoadBalancer.Arn,
            Port = 443,
            Protocol = "HTTPS",
            SslPolicy = "ELBSecurityPolicy-2016-08",
        });
    }

}
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 {
        frontEndLoadBalancer, err := lb.NewLoadBalancer(ctx, "frontEndLoadBalancer", nil)
        if err != nil {
            return err
        }
        frontEndTargetGroup, err := lb.NewTargetGroup(ctx, "frontEndTargetGroup", nil)
        if err != nil {
            return err
        }
        _, err = lb.NewListener(ctx, "frontEndListener", &lb.ListenerArgs{
            CertificateArn: pulumi.String("arn:aws:iam::187416307283:server-certificate/test_cert_rab3wuqwgja25ct3n4jdj2tzu4"),
            DefaultActions: lb.ListenerDefaultActionArray{
                &lb.ListenerDefaultActionArgs{
                    TargetGroupArn: frontEndTargetGroup.Arn,
                    Type:           pulumi.String("forward"),
                },
            },
            LoadBalancerArn: frontEndLoadBalancer.Arn,
            Port:            pulumi.Int(443),
            Protocol:        pulumi.String("HTTPS"),
            SslPolicy:       pulumi.String("ELBSecurityPolicy-2016-08"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

front_end_load_balancer = aws.lb.LoadBalancer("frontEndLoadBalancer")
front_end_target_group = aws.lb.TargetGroup("frontEndTargetGroup")
front_end_listener = aws.lb.Listener("frontEndListener",
    certificate_arn="arn:aws:iam::187416307283:server-certificate/test_cert_rab3wuqwgja25ct3n4jdj2tzu4",
    default_actions=[{
        "target_group_arn": front_end_target_group.arn,
        "type": "forward",
    }],
    load_balancer_arn=front_end_load_balancer.arn,
    port="443",
    protocol="HTTPS",
    ssl_policy="ELBSecurityPolicy-2016-08")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndTargetGroup = new aws.lb.TargetGroup("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    certificateArn: "arn:aws:iam::187416307283:server-certificate/test_cert_rab3wuqwgja25ct3n4jdj2tzu4",
    defaultActions: [{
        targetGroupArn: frontEndTargetGroup.arn,
        type: "forward",
    }],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 443,
    protocol: "HTTPS",
    sslPolicy: "ELBSecurityPolicy-2016-08",
});

Redirect Action

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var frontEndLoadBalancer = new Aws.LB.LoadBalancer("frontEndLoadBalancer", new Aws.LB.LoadBalancerArgs
        {
        });
        var frontEndListener = new Aws.LB.Listener("frontEndListener", new Aws.LB.ListenerArgs
        {
            DefaultActions = 
            {
                new Aws.LB.Inputs.ListenerDefaultActionArgs
                {
                    Redirect = new Aws.LB.Inputs.ListenerDefaultActionRedirectArgs
                    {
                        Port = "443",
                        Protocol = "HTTPS",
                        StatusCode = "HTTP_301",
                    },
                    Type = "redirect",
                },
            },
            LoadBalancerArn = frontEndLoadBalancer.Arn,
            Port = 80,
            Protocol = "HTTP",
        });
    }

}
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 {
        frontEndLoadBalancer, err := lb.NewLoadBalancer(ctx, "frontEndLoadBalancer", nil)
        if err != nil {
            return err
        }
        _, err = lb.NewListener(ctx, "frontEndListener", &lb.ListenerArgs{
            DefaultActions: lb.ListenerDefaultActionArray{
                &lb.ListenerDefaultActionArgs{
                    Redirect: &lb.ListenerDefaultActionRedirectArgs{
                        Port:       pulumi.String("443"),
                        Protocol:   pulumi.String("HTTPS"),
                        StatusCode: pulumi.String("HTTP_301"),
                    },
                    Type: pulumi.String("redirect"),
                },
            },
            LoadBalancerArn: frontEndLoadBalancer.Arn,
            Port:            pulumi.Int(80),
            Protocol:        pulumi.String("HTTP"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

front_end_load_balancer = aws.lb.LoadBalancer("frontEndLoadBalancer")
front_end_listener = aws.lb.Listener("frontEndListener",
    default_actions=[{
        "redirect": {
            "port": "443",
            "protocol": "HTTPS",
            "status_code": "HTTP_301",
        },
        "type": "redirect",
    }],
    load_balancer_arn=front_end_load_balancer.arn,
    port="80",
    protocol="HTTP")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    defaultActions: [{
        redirect: {
            port: "443",
            protocol: "HTTPS",
            statusCode: "HTTP_301",
        },
        type: "redirect",
    }],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 80,
    protocol: "HTTP",
});

Fixed-response Action

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var frontEndLoadBalancer = new Aws.LB.LoadBalancer("frontEndLoadBalancer", new Aws.LB.LoadBalancerArgs
        {
        });
        var frontEndListener = new Aws.LB.Listener("frontEndListener", new Aws.LB.ListenerArgs
        {
            DefaultActions = 
            {
                new Aws.LB.Inputs.ListenerDefaultActionArgs
                {
                    FixedResponse = new Aws.LB.Inputs.ListenerDefaultActionFixedResponseArgs
                    {
                        ContentType = "text/plain",
                        MessageBody = "Fixed response content",
                        StatusCode = "200",
                    },
                    Type = "fixed-response",
                },
            },
            LoadBalancerArn = frontEndLoadBalancer.Arn,
            Port = 80,
            Protocol = "HTTP",
        });
    }

}
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 {
        frontEndLoadBalancer, err := lb.NewLoadBalancer(ctx, "frontEndLoadBalancer", nil)
        if err != nil {
            return err
        }
        _, err = lb.NewListener(ctx, "frontEndListener", &lb.ListenerArgs{
            DefaultActions: lb.ListenerDefaultActionArray{
                &lb.ListenerDefaultActionArgs{
                    FixedResponse: &lb.ListenerDefaultActionFixedResponseArgs{
                        ContentType: pulumi.String("text/plain"),
                        MessageBody: pulumi.String("Fixed response content"),
                        StatusCode:  pulumi.String("200"),
                    },
                    Type: pulumi.String("fixed-response"),
                },
            },
            LoadBalancerArn: frontEndLoadBalancer.Arn,
            Port:            pulumi.Int(80),
            Protocol:        pulumi.String("HTTP"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

front_end_load_balancer = aws.lb.LoadBalancer("frontEndLoadBalancer")
front_end_listener = aws.lb.Listener("frontEndListener",
    default_actions=[{
        "fixedResponse": {
            "content_type": "text/plain",
            "messageBody": "Fixed response content",
            "status_code": "200",
        },
        "type": "fixed-response",
    }],
    load_balancer_arn=front_end_load_balancer.arn,
    port="80",
    protocol="HTTP")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    defaultActions: [{
        fixedResponse: {
            contentType: "text/plain",
            messageBody: "Fixed response content",
            statusCode: "200",
        },
        type: "fixed-response",
    }],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 80,
    protocol: "HTTP",
});

Authenticate-cognito Action

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var frontEndLoadBalancer = new Aws.LB.LoadBalancer("frontEndLoadBalancer", new Aws.LB.LoadBalancerArgs
        {
        });
        var frontEndTargetGroup = new Aws.LB.TargetGroup("frontEndTargetGroup", new Aws.LB.TargetGroupArgs
        {
        });
        var pool = new Aws.Cognito.UserPool("pool", new Aws.Cognito.UserPoolArgs
        {
        });
        var client = new Aws.Cognito.UserPoolClient("client", new Aws.Cognito.UserPoolClientArgs
        {
        });
        var domain = new Aws.Cognito.UserPoolDomain("domain", new Aws.Cognito.UserPoolDomainArgs
        {
        });
        var frontEndListener = new Aws.LB.Listener("frontEndListener", new Aws.LB.ListenerArgs
        {
            DefaultActions = 
            {
                new Aws.LB.Inputs.ListenerDefaultActionArgs
                {
                    AuthenticateCognito = new Aws.LB.Inputs.ListenerDefaultActionAuthenticateCognitoArgs
                    {
                        UserPoolArn = pool.Arn,
                        UserPoolClientId = client.Id,
                        UserPoolDomain = domain.Domain,
                    },
                    Type = "authenticate-cognito",
                },
                new Aws.LB.Inputs.ListenerDefaultActionArgs
                {
                    TargetGroupArn = frontEndTargetGroup.Arn,
                    Type = "forward",
                },
            },
            LoadBalancerArn = frontEndLoadBalancer.Arn,
            Port = 80,
            Protocol = "HTTP",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/cognito"
    "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 {
        frontEndLoadBalancer, err := lb.NewLoadBalancer(ctx, "frontEndLoadBalancer", nil)
        if err != nil {
            return err
        }
        frontEndTargetGroup, err := lb.NewTargetGroup(ctx, "frontEndTargetGroup", nil)
        if err != nil {
            return err
        }
        pool, err := cognito.NewUserPool(ctx, "pool", nil)
        if err != nil {
            return err
        }
        client, err := cognito.NewUserPoolClient(ctx, "client", nil)
        if err != nil {
            return err
        }
        domain, err := cognito.NewUserPoolDomain(ctx, "domain", nil)
        if err != nil {
            return err
        }
        _, err = lb.NewListener(ctx, "frontEndListener", &lb.ListenerArgs{
            DefaultActions: lb.ListenerDefaultActionArray{
                &lb.ListenerDefaultActionArgs{
                    AuthenticateCognito: &lb.ListenerDefaultActionAuthenticateCognitoArgs{
                        UserPoolArn:      pool.Arn,
                        UserPoolClientId: client.ID(),
                        UserPoolDomain:   domain.Domain,
                    },
                    Type: pulumi.String("authenticate-cognito"),
                },
                &lb.ListenerDefaultActionArgs{
                    TargetGroupArn: frontEndTargetGroup.Arn,
                    Type:           pulumi.String("forward"),
                },
            },
            LoadBalancerArn: frontEndLoadBalancer.Arn,
            Port:            pulumi.Int(80),
            Protocol:        pulumi.String("HTTP"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

front_end_load_balancer = aws.lb.LoadBalancer("frontEndLoadBalancer")
front_end_target_group = aws.lb.TargetGroup("frontEndTargetGroup")
pool = aws.cognito.UserPool("pool")
client = aws.cognito.UserPoolClient("client")
domain = aws.cognito.UserPoolDomain("domain")
front_end_listener = aws.lb.Listener("frontEndListener",
    default_actions=[
        {
            "authenticateCognito": {
                "userPoolArn": pool.arn,
                "userPoolClientId": client.id,
                "userPoolDomain": domain.domain,
            },
            "type": "authenticate-cognito",
        },
        {
            "target_group_arn": front_end_target_group.arn,
            "type": "forward",
        },
    ],
    load_balancer_arn=front_end_load_balancer.arn,
    port="80",
    protocol="HTTP")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndTargetGroup = new aws.lb.TargetGroup("front_end", {});
const pool = new aws.cognito.UserPool("pool", {});
const client = new aws.cognito.UserPoolClient("client", {});
const domain = new aws.cognito.UserPoolDomain("domain", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    defaultActions: [
        {
            authenticateCognito: {
                userPoolArn: pool.arn,
                userPoolClientId: client.id,
                userPoolDomain: domain.domain,
            },
            type: "authenticate-cognito",
        },
        {
            targetGroupArn: frontEndTargetGroup.arn,
            type: "forward",
        },
    ],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 80,
    protocol: "HTTP",
});

Authenticate-oidc Action

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var frontEndLoadBalancer = new Aws.LB.LoadBalancer("frontEndLoadBalancer", new Aws.LB.LoadBalancerArgs
        {
        });
        var frontEndTargetGroup = new Aws.LB.TargetGroup("frontEndTargetGroup", new Aws.LB.TargetGroupArgs
        {
        });
        var frontEndListener = new Aws.LB.Listener("frontEndListener", new Aws.LB.ListenerArgs
        {
            DefaultActions = 
            {
                new Aws.LB.Inputs.ListenerDefaultActionArgs
                {
                    AuthenticateOidc = new Aws.LB.Inputs.ListenerDefaultActionAuthenticateOidcArgs
                    {
                        AuthorizationEndpoint = "https://example.com/authorization_endpoint",
                        ClientId = "client_id",
                        ClientSecret = "client_secret",
                        Issuer = "https://example.com",
                        TokenEndpoint = "https://example.com/token_endpoint",
                        UserInfoEndpoint = "https://example.com/user_info_endpoint",
                    },
                    Type = "authenticate-oidc",
                },
                new Aws.LB.Inputs.ListenerDefaultActionArgs
                {
                    TargetGroupArn = frontEndTargetGroup.Arn,
                    Type = "forward",
                },
            },
            LoadBalancerArn = frontEndLoadBalancer.Arn,
            Port = 80,
            Protocol = "HTTP",
        });
    }

}
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 {
        frontEndLoadBalancer, err := lb.NewLoadBalancer(ctx, "frontEndLoadBalancer", nil)
        if err != nil {
            return err
        }
        frontEndTargetGroup, err := lb.NewTargetGroup(ctx, "frontEndTargetGroup", nil)
        if err != nil {
            return err
        }
        _, err = lb.NewListener(ctx, "frontEndListener", &lb.ListenerArgs{
            DefaultActions: lb.ListenerDefaultActionArray{
                &lb.ListenerDefaultActionArgs{
                    AuthenticateOidc: &lb.ListenerDefaultActionAuthenticateOidcArgs{
                        AuthorizationEndpoint: pulumi.String("https://example.com/authorization_endpoint"),
                        ClientId:              pulumi.String("client_id"),
                        ClientSecret:          pulumi.String("client_secret"),
                        Issuer:                pulumi.String("https://example.com"),
                        TokenEndpoint:         pulumi.String("https://example.com/token_endpoint"),
                        UserInfoEndpoint:      pulumi.String("https://example.com/user_info_endpoint"),
                    },
                    Type: pulumi.String("authenticate-oidc"),
                },
                &lb.ListenerDefaultActionArgs{
                    TargetGroupArn: frontEndTargetGroup.Arn,
                    Type:           pulumi.String("forward"),
                },
            },
            LoadBalancerArn: frontEndLoadBalancer.Arn,
            Port:            pulumi.Int(80),
            Protocol:        pulumi.String("HTTP"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

front_end_load_balancer = aws.lb.LoadBalancer("frontEndLoadBalancer")
front_end_target_group = aws.lb.TargetGroup("frontEndTargetGroup")
front_end_listener = aws.lb.Listener("frontEndListener",
    default_actions=[
        {
            "authenticateOidc": {
                "authorizationEndpoint": "https://example.com/authorization_endpoint",
                "client_id": "client_id",
                "client_secret": "client_secret",
                "issuer": "https://example.com",
                "tokenEndpoint": "https://example.com/token_endpoint",
                "userInfoEndpoint": "https://example.com/user_info_endpoint",
            },
            "type": "authenticate-oidc",
        },
        {
            "target_group_arn": front_end_target_group.arn,
            "type": "forward",
        },
    ],
    load_balancer_arn=front_end_load_balancer.arn,
    port="80",
    protocol="HTTP")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndTargetGroup = new aws.lb.TargetGroup("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    defaultActions: [
        {
            authenticateOidc: {
                authorizationEndpoint: "https://example.com/authorization_endpoint",
                clientId: "client_id",
                clientSecret: "client_secret",
                issuer: "https://example.com",
                tokenEndpoint: "https://example.com/token_endpoint",
                userInfoEndpoint: "https://example.com/user_info_endpoint",
            },
            type: "authenticate-oidc",
        },
        {
            targetGroupArn: frontEndTargetGroup.arn,
            type: "forward",
        },
    ],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 80,
    protocol: "HTTP",
});

Deprecated: aws.applicationloadbalancing.Listener has been deprecated in favor of aws.alb.Listener

Create a Listener Resource

def Listener(resource_name, opts=None, certificate_arn=None, default_actions=None, load_balancer_arn=None, port=None, protocol=None, ssl_policy=None, __props__=None);
func NewListener(ctx *Context, name string, args ListenerArgs, opts ...ResourceOption) (*Listener, error)
public Listener(string name, ListenerArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ListenerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ListenerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ListenerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Listener Resource Properties

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

Inputs

The Listener resource accepts the following input properties:

DefaultActions List<ListenerDefaultActionArgs>

An Action block. Action blocks are documented below.

LoadBalancerArn string

The ARN of the load balancer.

Port int

The port on which the load balancer is listening.

CertificateArn string

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

Protocol string

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

SslPolicy string

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

DefaultActions []ListenerDefaultAction

An Action block. Action blocks are documented below.

LoadBalancerArn string

The ARN of the load balancer.

Port int

The port on which the load balancer is listening.

CertificateArn string

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

Protocol string

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

SslPolicy string

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

defaultActions ListenerDefaultAction[]

An Action block. Action blocks are documented below.

loadBalancerArn string

The ARN of the load balancer.

port number

The port on which the load balancer is listening.

certificateArn string

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

protocol string

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

sslPolicy string

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

default_actions List[ListenerDefaultAction]

An Action block. Action blocks are documented below.

load_balancer_arn str

The ARN of the load balancer.

port float

The port on which the load balancer is listening.

certificate_arn str

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

protocol str

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

ssl_policy str

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

Outputs

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

Arn string

The Amazon Resource Name (ARN) of the target group.

Id string
The provider-assigned unique ID for this managed resource.
Arn string

The Amazon Resource Name (ARN) of the target group.

Id string
The provider-assigned unique ID for this managed resource.
arn string

The Amazon Resource Name (ARN) of the target group.

id string
The provider-assigned unique ID for this managed resource.
arn str

The Amazon Resource Name (ARN) of the target group.

id str
The provider-assigned unique ID for this managed resource.

Look up an 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
static get(resource_name, id, opts=None, arn=None, certificate_arn=None, default_actions=None, load_balancer_arn=None, port=None, protocol=None, ssl_policy=None, __props__=None);
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)
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:

Arn string

The Amazon Resource Name (ARN) of the target group.

CertificateArn string

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

DefaultActions List<ListenerDefaultActionArgs>

An Action block. Action blocks are documented below.

LoadBalancerArn string

The ARN of the load balancer.

Port int

The port on which the load balancer is listening.

Protocol string

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

SslPolicy string

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

Arn string

The Amazon Resource Name (ARN) of the target group.

CertificateArn string

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

DefaultActions []ListenerDefaultAction

An Action block. Action blocks are documented below.

LoadBalancerArn string

The ARN of the load balancer.

Port int

The port on which the load balancer is listening.

Protocol string

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

SslPolicy string

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

arn string

The Amazon Resource Name (ARN) of the target group.

certificateArn string

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

defaultActions ListenerDefaultAction[]

An Action block. Action blocks are documented below.

loadBalancerArn string

The ARN of the load balancer.

port number

The port on which the load balancer is listening.

protocol string

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

sslPolicy string

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

arn str

The Amazon Resource Name (ARN) of the target group.

certificate_arn str

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

default_actions List[ListenerDefaultAction]

An Action block. Action blocks are documented below.

load_balancer_arn str

The ARN of the load balancer.

port float

The port on which the load balancer is listening.

protocol str

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

ssl_policy str

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

Supporting Types

ListenerDefaultAction

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Type string

The type of routing action. Valid values are forward, redirect, fixed-response, authenticate-cognito and authenticate-oidc.

AuthenticateCognito ListenerDefaultActionAuthenticateCognitoArgs
AuthenticateOidc ListenerDefaultActionAuthenticateOidcArgs
FixedResponse ListenerDefaultActionFixedResponseArgs

Information for creating an action that returns a custom HTTP response. Required if type is fixed-response.

Forward ListenerDefaultActionForwardArgs

Information for creating an action that distributes requests among one or more target groups. Specify only if type is forward. If you specify both forward block and target_group_arn attribute, you can specify only one target group using forward and it must be the same target group specified in target_group_arn.

Order int
Redirect ListenerDefaultActionRedirectArgs

Information for creating a redirect action. Required if type is redirect.

TargetGroupArn string

The ARN of the Target Group to which to route traffic. Specify only if type is forward and you want to route to a single target group. To route to one or more target groups, use a forward block instead.

Type string

The type of routing action. Valid values are forward, redirect, fixed-response, authenticate-cognito and authenticate-oidc.

AuthenticateCognito ListenerDefaultActionAuthenticateCognito
AuthenticateOidc ListenerDefaultActionAuthenticateOidc
FixedResponse ListenerDefaultActionFixedResponse

Information for creating an action that returns a custom HTTP response. Required if type is fixed-response.

Forward ListenerDefaultActionForward

Information for creating an action that distributes requests among one or more target groups. Specify only if type is forward. If you specify both forward block and target_group_arn attribute, you can specify only one target group using forward and it must be the same target group specified in target_group_arn.

Order int
Redirect ListenerDefaultActionRedirect

Information for creating a redirect action. Required if type is redirect.

TargetGroupArn string

The ARN of the Target Group to which to route traffic. Specify only if type is forward and you want to route to a single target group. To route to one or more target groups, use a forward block instead.

type string

The type of routing action. Valid values are forward, redirect, fixed-response, authenticate-cognito and authenticate-oidc.

authenticateCognito ListenerDefaultActionAuthenticateCognito
authenticateOidc ListenerDefaultActionAuthenticateOidc
fixedResponse ListenerDefaultActionFixedResponse

Information for creating an action that returns a custom HTTP response. Required if type is fixed-response.

forward ListenerDefaultActionForward

Information for creating an action that distributes requests among one or more target groups. Specify only if type is forward. If you specify both forward block and target_group_arn attribute, you can specify only one target group using forward and it must be the same target group specified in target_group_arn.

order number
redirect ListenerDefaultActionRedirect

Information for creating a redirect action. Required if type is redirect.

targetGroupArn string

The ARN of the Target Group to which to route traffic. Specify only if type is forward and you want to route to a single target group. To route to one or more target groups, use a forward block instead.

type str

The type of routing action. Valid values are forward, redirect, fixed-response, authenticate-cognito and authenticate-oidc.

authenticateCognito Dict[ListenerDefaultActionAuthenticateCognito]
authenticateOidc Dict[ListenerDefaultActionAuthenticateOidc]
fixedResponse Dict[ListenerDefaultActionFixedResponse]

Information for creating an action that returns a custom HTTP response. Required if type is fixed-response.

forward Dict[ListenerDefaultActionForward]

Information for creating an action that distributes requests among one or more target groups. Specify only if type is forward. If you specify both forward block and target_group_arn attribute, you can specify only one target group using forward and it must be the same target group specified in target_group_arn.

order float
redirect Dict[ListenerDefaultActionRedirect]

Information for creating a redirect action. Required if type is redirect.

target_group_arn str

The ARN of the Target Group to which to route traffic. Specify only if type is forward and you want to route to a single target group. To route to one or more target groups, use a forward block instead.

ListenerDefaultActionAuthenticateCognito

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

UserPoolArn string

The ARN of the Cognito user pool.

UserPoolClientId string

The ID of the Cognito user pool client.

UserPoolDomain string

The domain prefix or fully-qualified domain name of the Cognito user pool.

AuthenticationRequestExtraParams Dictionary<string, string>

The query parameters to include in the redirect request to the authorization endpoint. Max: 10.

OnUnauthenticatedRequest string

The behavior if the user is not authenticated. Valid values: deny, allow and authenticate

Scope string

The set of user claims to be requested from the IdP.

SessionCookieName string

The name of the cookie used to maintain session information.

SessionTimeout int

The maximum duration of the authentication session, in seconds.

UserPoolArn string

The ARN of the Cognito user pool.

UserPoolClientId string

The ID of the Cognito user pool client.

UserPoolDomain string

The domain prefix or fully-qualified domain name of the Cognito user pool.

AuthenticationRequestExtraParams map[string]string

The query parameters to include in the redirect request to the authorization endpoint. Max: 10.

OnUnauthenticatedRequest string

The behavior if the user is not authenticated. Valid values: deny, allow and authenticate

Scope string

The set of user claims to be requested from the IdP.

SessionCookieName string

The name of the cookie used to maintain session information.

SessionTimeout int

The maximum duration of the authentication session, in seconds.

userPoolArn string

The ARN of the Cognito user pool.

userPoolClientId string

The ID of the Cognito user pool client.

userPoolDomain string

The domain prefix or fully-qualified domain name of the Cognito user pool.

authenticationRequestExtraParams {[key: string]: string}

The query parameters to include in the redirect request to the authorization endpoint. Max: 10.

onUnauthenticatedRequest string

The behavior if the user is not authenticated. Valid values: deny, allow and authenticate

scope string

The set of user claims to be requested from the IdP.

sessionCookieName string

The name of the cookie used to maintain session information.

sessionTimeout number

The maximum duration of the authentication session, in seconds.

userPoolArn str

The ARN of the Cognito user pool.

userPoolClientId str

The ID of the Cognito user pool client.

userPoolDomain str

The domain prefix or fully-qualified domain name of the Cognito user pool.

authenticationRequestExtraParams Dict[str, str]

The query parameters to include in the redirect request to the authorization endpoint. Max: 10.

onUnauthenticatedRequest str

The behavior if the user is not authenticated. Valid values: deny, allow and authenticate

scope str

The set of user claims to be requested from the IdP.

sessionCookieName str

The name of the cookie used to maintain session information.

sessionTimeout float

The maximum duration of the authentication session, in seconds.

ListenerDefaultActionAuthenticateOidc

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AuthorizationEndpoint string

The authorization endpoint of the IdP.

ClientId string

The OAuth 2.0 client identifier.

ClientSecret string

The OAuth 2.0 client secret.

Issuer string

The OIDC issuer identifier of the IdP.

TokenEndpoint string

The token endpoint of the IdP.

UserInfoEndpoint string

The user info endpoint of the IdP.

AuthenticationRequestExtraParams Dictionary<string, string>

The query parameters to include in the redirect request to the authorization endpoint. Max: 10.

OnUnauthenticatedRequest string

The behavior if the user is not authenticated. Valid values: deny, allow and authenticate

Scope string

The set of user claims to be requested from the IdP.

SessionCookieName string

The name of the cookie used to maintain session information.

SessionTimeout int

The maximum duration of the authentication session, in seconds.

AuthorizationEndpoint string

The authorization endpoint of the IdP.

ClientId string

The OAuth 2.0 client identifier.

ClientSecret string

The OAuth 2.0 client secret.

Issuer string

The OIDC issuer identifier of the IdP.

TokenEndpoint string

The token endpoint of the IdP.

UserInfoEndpoint string

The user info endpoint of the IdP.

AuthenticationRequestExtraParams map[string]string

The query parameters to include in the redirect request to the authorization endpoint. Max: 10.

OnUnauthenticatedRequest string

The behavior if the user is not authenticated. Valid values: deny, allow and authenticate

Scope string

The set of user claims to be requested from the IdP.

SessionCookieName string

The name of the cookie used to maintain session information.

SessionTimeout int

The maximum duration of the authentication session, in seconds.

authorizationEndpoint string

The authorization endpoint of the IdP.

clientId string

The OAuth 2.0 client identifier.

clientSecret string

The OAuth 2.0 client secret.

issuer string

The OIDC issuer identifier of the IdP.

tokenEndpoint string

The token endpoint of the IdP.

userInfoEndpoint string

The user info endpoint of the IdP.

authenticationRequestExtraParams {[key: string]: string}

The query parameters to include in the redirect request to the authorization endpoint. Max: 10.

onUnauthenticatedRequest string

The behavior if the user is not authenticated. Valid values: deny, allow and authenticate

scope string

The set of user claims to be requested from the IdP.

sessionCookieName string

The name of the cookie used to maintain session information.

sessionTimeout number

The maximum duration of the authentication session, in seconds.

authorizationEndpoint str

The authorization endpoint of the IdP.

client_id str

The OAuth 2.0 client identifier.

client_secret str

The OAuth 2.0 client secret.

issuer str

The OIDC issuer identifier of the IdP.

tokenEndpoint str

The token endpoint of the IdP.

userInfoEndpoint str

The user info endpoint of the IdP.

authenticationRequestExtraParams Dict[str, str]

The query parameters to include in the redirect request to the authorization endpoint. Max: 10.

onUnauthenticatedRequest str

The behavior if the user is not authenticated. Valid values: deny, allow and authenticate

scope str

The set of user claims to be requested from the IdP.

sessionCookieName str

The name of the cookie used to maintain session information.

sessionTimeout float

The maximum duration of the authentication session, in seconds.

ListenerDefaultActionFixedResponse

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

ContentType string

The content type. Valid values are text/plain, text/css, text/html, application/javascript and application/json.

MessageBody string

The message body.

StatusCode string

The HTTP response code. Valid values are 2XX, 4XX, or 5XX.

ContentType string

The content type. Valid values are text/plain, text/css, text/html, application/javascript and application/json.

MessageBody string

The message body.

StatusCode string

The HTTP response code. Valid values are 2XX, 4XX, or 5XX.

contentType string

The content type. Valid values are text/plain, text/css, text/html, application/javascript and application/json.

messageBody string

The message body.

statusCode string

The HTTP response code. Valid values are 2XX, 4XX, or 5XX.

content_type str

The content type. Valid values are text/plain, text/css, text/html, application/javascript and application/json.

messageBody str

The message body.

status_code str

The HTTP response code. Valid values are 2XX, 4XX, or 5XX.

ListenerDefaultActionForward

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

TargetGroups List<ListenerDefaultActionForwardTargetGroupArgs>

One or more target groups block.

Stickiness ListenerDefaultActionForwardStickinessArgs

The target group stickiness for the rule.

TargetGroups []ListenerDefaultActionForwardTargetGroup

One or more target groups block.

Stickiness ListenerDefaultActionForwardStickiness

The target group stickiness for the rule.

targetGroups ListenerDefaultActionForwardTargetGroup[]

One or more target groups block.

stickiness ListenerDefaultActionForwardStickiness

The target group stickiness for the rule.

targetGroups List[ListenerDefaultActionForwardTargetGroup]

One or more target groups block.

stickiness Dict[ListenerDefaultActionForwardStickiness]

The target group stickiness for the rule.

ListenerDefaultActionForwardStickiness

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Duration int

The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days).

Enabled bool

Indicates whether target group stickiness is enabled.

Duration int

The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days).

Enabled bool

Indicates whether target group stickiness is enabled.

duration number

The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days).

enabled boolean

Indicates whether target group stickiness is enabled.

duration float

The time period, in seconds, during which requests from a client should be routed to the same target group. The range is 1-604800 seconds (7 days).

enabled bool

Indicates whether target group stickiness is enabled.

ListenerDefaultActionForwardTargetGroup

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Arn string

The Amazon Resource Name (ARN) of the target group.

Weight int

The weight. The range is 0 to 999.

Arn string

The Amazon Resource Name (ARN) of the target group.

Weight int

The weight. The range is 0 to 999.

arn string

The Amazon Resource Name (ARN) of the target group.

weight number

The weight. The range is 0 to 999.

arn str

The Amazon Resource Name (ARN) of the target group.

weight float

The weight. The range is 0 to 999.

ListenerDefaultActionRedirect

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

StatusCode string

The HTTP redirect code. The redirect is either permanent (HTTP_301) or temporary (HTTP_302).

Host string

The hostname. This component is not percent-encoded. The hostname can contain #{host}. Defaults to #{host}.

Path string

The absolute path, starting with the leading “/”. This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}. Defaults to /#{path}.

Port string

The port. Specify a value from 1 to 65535 or #{port}. Defaults to #{port}.

Protocol string

The protocol. Valid values are HTTP, HTTPS, or #{protocol}. Defaults to #{protocol}.

Query string

The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading “?”. Defaults to #{query}.

StatusCode string

The HTTP redirect code. The redirect is either permanent (HTTP_301) or temporary (HTTP_302).

Host string

The hostname. This component is not percent-encoded. The hostname can contain #{host}. Defaults to #{host}.

Path string

The absolute path, starting with the leading “/”. This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}. Defaults to /#{path}.

Port string

The port. Specify a value from 1 to 65535 or #{port}. Defaults to #{port}.

Protocol string

The protocol. Valid values are HTTP, HTTPS, or #{protocol}. Defaults to #{protocol}.

Query string

The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading “?”. Defaults to #{query}.

statusCode string

The HTTP redirect code. The redirect is either permanent (HTTP_301) or temporary (HTTP_302).

host string

The hostname. This component is not percent-encoded. The hostname can contain #{host}. Defaults to #{host}.

path string

The absolute path, starting with the leading “/”. This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}. Defaults to /#{path}.

port string

The port. Specify a value from 1 to 65535 or #{port}. Defaults to #{port}.

protocol string

The protocol. Valid values are HTTP, HTTPS, or #{protocol}. Defaults to #{protocol}.

query string

The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading “?”. Defaults to #{query}.

status_code str

The HTTP redirect code. The redirect is either permanent (HTTP_301) or temporary (HTTP_302).

host str

The hostname. This component is not percent-encoded. The hostname can contain #{host}. Defaults to #{host}.

path str

The absolute path, starting with the leading “/”. This component is not percent-encoded. The path can contain #{host}, #{path}, and #{port}. Defaults to /#{path}.

port str

The port. Specify a value from 1 to 65535 or #{port}. Defaults to #{port}.

protocol str

The protocol. Valid values are HTTP, HTTPS, or #{protocol}. Defaults to #{protocol}.

query str

The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading “?”. Defaults to #{query}.

Package Details

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