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
new Listener(name: string, args: ListenerArgs, opts?: CustomResourceOptions);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:
- Accelerator
Arn string The Amazon Resource Name (ARN) of your accelerator.
- Port
Ranges List<ListenerPort Range Args> 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.- Client
Affinity string Direct all requests from a user to the same endpoint. Valid values are
NONE,SOURCE_IP. Default:NONE. IfNONE, 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. IfSOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.
- Accelerator
Arn string The Amazon Resource Name (ARN) of your accelerator.
- Port
Ranges []ListenerPort Range 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.- Client
Affinity string Direct all requests from a user to the same endpoint. Valid values are
NONE,SOURCE_IP. Default:NONE. IfNONE, 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. IfSOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.
- accelerator
Arn string The Amazon Resource Name (ARN) of your accelerator.
- port
Ranges ListenerPort Range[] 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.- client
Affinity string Direct all requests from a user to the same endpoint. Valid values are
NONE,SOURCE_IP. Default:NONE. IfNONE, 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. IfSOURCE_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[ListenerPort Range] 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. IfNONE, 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. IfSOURCE_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:
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): Listenerstatic 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:
- Accelerator
Arn string The Amazon Resource Name (ARN) of your accelerator.
- Client
Affinity string Direct all requests from a user to the same endpoint. Valid values are
NONE,SOURCE_IP. Default:NONE. IfNONE, 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. IfSOURCE_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<ListenerPort Range Args> 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 string The Amazon Resource Name (ARN) of your accelerator.
- Client
Affinity string Direct all requests from a user to the same endpoint. Valid values are
NONE,SOURCE_IP. Default:NONE. IfNONE, 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. IfSOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.- Port
Ranges []ListenerPort Range 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 string The Amazon Resource Name (ARN) of your accelerator.
- client
Affinity string Direct all requests from a user to the same endpoint. Valid values are
NONE,SOURCE_IP. Default:NONE. IfNONE, 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. IfSOURCE_IP, Global Accelerator uses the “two-tuple” properties of source (client) IP address and destination IP address to select the hash value.- port
Ranges ListenerPort Range[] 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. IfNONE, 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. IfSOURCE_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[ListenerPort Range] 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
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.