Listener Args
data class ListenerArgs(val acceleratorArn: Output<String>? = null, val clientAffinity: Output<String>? = null, val portRanges: Output<List<ListenerPortRangeArgs>>? = null, val protocol: Output<String>? = null) : ConvertibleToJava<ListenerArgs>
Provides a Global Accelerator listener.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.globalaccelerator.Accelerator("example", {
name: "Example",
ipAddressType: "IPV4",
enabled: true,
attributes: {
flowLogsEnabled: true,
flowLogsS3Bucket: "example-bucket",
flowLogsS3Prefix: "flow-logs/",
},
});
const exampleListener = new aws.globalaccelerator.Listener("example", {
acceleratorArn: example.arn,
clientAffinity: "SOURCE_IP",
protocol: "TCP",
portRanges: [{
fromPort: 80,
toPort: 80,
}],
});
Content copied to clipboard
import pulumi
import pulumi_aws as aws
example = aws.globalaccelerator.Accelerator("example",
name="Example",
ip_address_type="IPV4",
enabled=True,
attributes={
"flow_logs_enabled": True,
"flow_logs_s3_bucket": "example-bucket",
"flow_logs_s3_prefix": "flow-logs/",
})
example_listener = aws.globalaccelerator.Listener("example",
accelerator_arn=example.arn,
client_affinity="SOURCE_IP",
protocol="TCP",
port_ranges=[{
"from_port": 80,
"to_port": 80,
}])
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.GlobalAccelerator.Accelerator("example", new()
{
Name = "Example",
IpAddressType = "IPV4",
Enabled = true,
Attributes = new Aws.GlobalAccelerator.Inputs.AcceleratorAttributesArgs
{
FlowLogsEnabled = true,
FlowLogsS3Bucket = "example-bucket",
FlowLogsS3Prefix = "flow-logs/",
},
});
var exampleListener = new Aws.GlobalAccelerator.Listener("example", new()
{
AcceleratorArn = example.Arn,
ClientAffinity = "SOURCE_IP",
Protocol = "TCP",
PortRanges = new[]
{
new Aws.GlobalAccelerator.Inputs.ListenerPortRangeArgs
{
FromPort = 80,
ToPort = 80,
},
},
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/globalaccelerator"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := globalaccelerator.NewAccelerator(ctx, "example", &globalaccelerator.AcceleratorArgs{
Name: pulumi.String("Example"),
IpAddressType: pulumi.String("IPV4"),
Enabled: pulumi.Bool(true),
Attributes: &globalaccelerator.AcceleratorAttributesArgs{
FlowLogsEnabled: pulumi.Bool(true),
FlowLogsS3Bucket: pulumi.String("example-bucket"),
FlowLogsS3Prefix: pulumi.String("flow-logs/"),
},
})
if err != nil {
return err
}
_, err = globalaccelerator.NewListener(ctx, "example", &globalaccelerator.ListenerArgs{
AcceleratorArn: example.Arn,
ClientAffinity: pulumi.String("SOURCE_IP"),
Protocol: pulumi.String("TCP"),
PortRanges: globalaccelerator.ListenerPortRangeArray{
&globalaccelerator.ListenerPortRangeArgs{
FromPort: pulumi.Int(80),
ToPort: pulumi.Int(80),
},
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.globalaccelerator.Accelerator;
import com.pulumi.aws.globalaccelerator.AcceleratorArgs;
import com.pulumi.aws.globalaccelerator.inputs.AcceleratorAttributesArgs;
import com.pulumi.aws.globalaccelerator.Listener;
import com.pulumi.aws.globalaccelerator.ListenerArgs;
import com.pulumi.aws.globalaccelerator.inputs.ListenerPortRangeArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Accelerator("example", AcceleratorArgs.builder()
.name("Example")
.ipAddressType("IPV4")
.enabled(true)
.attributes(AcceleratorAttributesArgs.builder()
.flowLogsEnabled(true)
.flowLogsS3Bucket("example-bucket")
.flowLogsS3Prefix("flow-logs/")
.build())
.build());
var exampleListener = new Listener("exampleListener", ListenerArgs.builder()
.acceleratorArn(example.arn())
.clientAffinity("SOURCE_IP")
.protocol("TCP")
.portRanges(ListenerPortRangeArgs.builder()
.fromPort(80)
.toPort(80)
.build())
.build());
}
}
Content copied to clipboard
resources:
example:
type: aws:globalaccelerator:Accelerator
properties:
name: Example
ipAddressType: IPV4
enabled: true
attributes:
flowLogsEnabled: true
flowLogsS3Bucket: example-bucket
flowLogsS3Prefix: flow-logs/
exampleListener:
type: aws:globalaccelerator:Listener
name: example
properties:
acceleratorArn: ${example.arn}
clientAffinity: SOURCE_IP
protocol: TCP
portRanges:
- fromPort: 80
toPort: 80
Content copied to clipboard
Import
Using pulumi import
, import Global Accelerator listeners using the id
. For example:
$ pulumi import aws:globalaccelerator/listener:Listener example arn:aws:globalaccelerator::111111111111:accelerator/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/listener/xxxxxxxx
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(acceleratorArn: Output<String>? = null, clientAffinity: Output<String>? = null, portRanges: Output<List<ListenerPortRangeArgs>>? = null, protocol: Output<String>? = null)
Properties
Link copied to clipboard
The Amazon Resource Name (ARN) of your accelerator.
Link copied to clipboard
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.
Link copied to clipboard
The list of port ranges for the connections from clients to the accelerator. Fields documented below.