Listener

Provides a Global Accelerator listener.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleAccelerator = new Aws.GlobalAccelerator.Accelerator("exampleAccelerator", new Aws.GlobalAccelerator.AcceleratorArgs
        {
            Attributes = new Aws.GlobalAccelerator.Inputs.AcceleratorAttributesArgs
            {
                FlowLogsEnabled = true,
                FlowLogsS3Bucket = "example-bucket",
                FlowLogsS3Prefix = "flow-logs/",
            },
            Enabled = true,
            IpAddressType = "IPV4",
        });
        var exampleListener = new Aws.GlobalAccelerator.Listener("exampleListener", new Aws.GlobalAccelerator.ListenerArgs
        {
            AcceleratorArn = exampleAccelerator.Id,
            ClientAffinity = "SOURCE_IP",
            PortRanges = 
            {
                new Aws.GlobalAccelerator.Inputs.ListenerPortRangeArgs
                {
                    FromPort = 80,
                    ToPort = 80,
                },
            },
            Protocol = "TCP",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/globalaccelerator"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleAccelerator, err := globalaccelerator.NewAccelerator(ctx, "exampleAccelerator", &globalaccelerator.AcceleratorArgs{
            Attributes: &globalaccelerator.AcceleratorAttributesArgs{
                FlowLogsEnabled:  pulumi.Bool(true),
                FlowLogsS3Bucket: pulumi.String("example-bucket"),
                FlowLogsS3Prefix: pulumi.String("flow-logs/"),
            },
            Enabled:       pulumi.Bool(true),
            IpAddressType: pulumi.String("IPV4"),
        })
        if err != nil {
            return err
        }
        _, err = globalaccelerator.NewListener(ctx, "exampleListener", &globalaccelerator.ListenerArgs{
            AcceleratorArn: exampleAccelerator.ID(),
            ClientAffinity: pulumi.String("SOURCE_IP"),
            PortRanges: globalaccelerator.ListenerPortRangeArray{
                &globalaccelerator.ListenerPortRangeArgs{
                    FromPort: pulumi.Int(80),
                    ToPort:   pulumi.Int(80),
                },
            },
            Protocol: pulumi.String("TCP"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example_accelerator = aws.globalaccelerator.Accelerator("exampleAccelerator",
    attributes={
        "flowLogsEnabled": True,
        "flowLogsS3Bucket": "example-bucket",
        "flowLogsS3Prefix": "flow-logs/",
    },
    enabled=True,
    ip_address_type="IPV4")
example_listener = aws.globalaccelerator.Listener("exampleListener",
    accelerator_arn=example_accelerator.id,
    client_affinity="SOURCE_IP",
    port_ranges=[{
        "from_port": 80,
        "to_port": 80,
    }],
    protocol="TCP")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleAccelerator = new aws.globalaccelerator.Accelerator("example", {
    attributes: {
        flowLogsEnabled: true,
        flowLogsS3Bucket: "example-bucket",
        flowLogsS3Prefix: "flow-logs/",
    },
    enabled: true,
    ipAddressType: "IPV4",
});
const exampleListener = new aws.globalaccelerator.Listener("example", {
    acceleratorArn: exampleAccelerator.id,
    clientAffinity: "SOURCE_IP",
    portRanges: [{
        fromPort: 80,
        toPort: 80,
    }],
    protocol: "TCP",
});

Create a Listener Resource

def Listener(resource_name, opts=None, accelerator_arn=None, client_affinity=None, port_ranges=None, protocol=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:

AcceleratorArn string

The Amazon Resource Name (ARN) of your accelerator.

PortRanges List<ListenerPortRangeArgs>

The list of port ranges for the connections from clients to the accelerator. Fields documented below.

Protocol string

The protocol for the connections from clients to the accelerator. Valid values are TCP, UDP.

ClientAffinity string

Direct all requests from a user to the same endpoint. Valid values are NONE, SOURCE_IP. Default: NONE. If NONE, Global Accelerator uses the “five-tuple” properties of source IP address, source port, destination IP address, destination port, and protocol to select the hash value. If SOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.

AcceleratorArn string

The Amazon Resource Name (ARN) of your accelerator.

PortRanges []ListenerPortRange

The list of port ranges for the connections from clients to the accelerator. Fields documented below.

Protocol string

The protocol for the connections from clients to the accelerator. Valid values are TCP, UDP.

ClientAffinity string

Direct all requests from a user to the same endpoint. Valid values are NONE, SOURCE_IP. Default: NONE. If NONE, Global Accelerator uses the “five-tuple” properties of source IP address, source port, destination IP address, destination port, and protocol to select the hash value. If SOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.

acceleratorArn string

The Amazon Resource Name (ARN) of your accelerator.

portRanges ListenerPortRange[]

The list of port ranges for the connections from clients to the accelerator. Fields documented below.

protocol string

The protocol for the connections from clients to the accelerator. Valid values are TCP, UDP.

clientAffinity string

Direct all requests from a user to the same endpoint. Valid values are NONE, SOURCE_IP. Default: NONE. If NONE, Global Accelerator uses the “five-tuple” properties of source IP address, source port, destination IP address, destination port, and protocol to select the hash value. If SOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.

accelerator_arn str

The Amazon Resource Name (ARN) of your accelerator.

port_ranges List[ListenerPortRange]

The list of port ranges for the connections from clients to the accelerator. Fields documented below.

protocol str

The protocol for the connections from clients to the accelerator. Valid values are TCP, UDP.

client_affinity str

Direct all requests from a user to the same endpoint. Valid values are NONE, SOURCE_IP. Default: NONE. If NONE, Global Accelerator uses the “five-tuple” properties of source IP address, source port, destination IP address, destination port, and protocol to select the hash value. If SOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
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, accelerator_arn=None, client_affinity=None, port_ranges=None, protocol=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:

AcceleratorArn string

The Amazon Resource Name (ARN) of your accelerator.

ClientAffinity string

Direct all requests from a user to the same endpoint. Valid values are NONE, SOURCE_IP. Default: NONE. If NONE, Global Accelerator uses the “five-tuple” properties of source IP address, source port, destination IP address, destination port, and protocol to select the hash value. If SOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.

PortRanges List<ListenerPortRangeArgs>

The list of port ranges for the connections from clients to the accelerator. Fields documented below.

Protocol string

The protocol for the connections from clients to the accelerator. Valid values are TCP, UDP.

AcceleratorArn string

The Amazon Resource Name (ARN) of your accelerator.

ClientAffinity string

Direct all requests from a user to the same endpoint. Valid values are NONE, SOURCE_IP. Default: NONE. If NONE, Global Accelerator uses the “five-tuple” properties of source IP address, source port, destination IP address, destination port, and protocol to select the hash value. If SOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.

PortRanges []ListenerPortRange

The list of port ranges for the connections from clients to the accelerator. Fields documented below.

Protocol string

The protocol for the connections from clients to the accelerator. Valid values are TCP, UDP.

acceleratorArn string

The Amazon Resource Name (ARN) of your accelerator.

clientAffinity string

Direct all requests from a user to the same endpoint. Valid values are NONE, SOURCE_IP. Default: NONE. If NONE, Global Accelerator uses the “five-tuple” properties of source IP address, source port, destination IP address, destination port, and protocol to select the hash value. If SOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.

portRanges ListenerPortRange[]

The list of port ranges for the connections from clients to the accelerator. Fields documented below.

protocol string

The protocol for the connections from clients to the accelerator. Valid values are TCP, UDP.

accelerator_arn str

The Amazon Resource Name (ARN) of your accelerator.

client_affinity str

Direct all requests from a user to the same endpoint. Valid values are NONE, SOURCE_IP. Default: NONE. If NONE, Global Accelerator uses the “five-tuple” properties of source IP address, source port, destination IP address, destination port, and protocol to select the hash value. If SOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.

port_ranges List[ListenerPortRange]

The list of port ranges for the connections from clients to the accelerator. Fields documented below.

protocol str

The protocol for the connections from clients to the accelerator. Valid values are TCP, UDP.

Supporting Types

ListenerPortRange

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.

FromPort int

The first port in the range of ports, inclusive.

ToPort int

The last port in the range of ports, inclusive.

FromPort int

The first port in the range of ports, inclusive.

ToPort int

The last port in the range of ports, inclusive.

fromPort number

The first port in the range of ports, inclusive.

toPort number

The last port in the range of ports, inclusive.

from_port float

The first port in the range of ports, inclusive.

to_port float

The last port in the range of ports, inclusive.

Package Details

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