1. Packages
  2. AWS
  3. API Docs
  4. globalaccelerator
  5. CustomRoutingListener
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.globalaccelerator.CustomRoutingListener

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides a Global Accelerator custom routing listener.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.globalaccelerator.CustomRoutingAccelerator("example", {
        name: "Example",
        ipAddressType: "IPV4",
        enabled: true,
        attributes: {
            flowLogsEnabled: true,
            flowLogsS3Bucket: "example-bucket",
            flowLogsS3Prefix: "flow-logs/",
        },
    });
    const exampleCustomRoutingListener = new aws.globalaccelerator.CustomRoutingListener("example", {
        acceleratorArn: example.id,
        portRanges: [{
            fromPort: 80,
            toPort: 80,
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.globalaccelerator.CustomRoutingAccelerator("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_custom_routing_listener = aws.globalaccelerator.CustomRoutingListener("example",
        accelerator_arn=example.id,
        port_ranges=[{
            "from_port": 80,
            "to_port": 80,
        }])
    
    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.NewCustomRoutingAccelerator(ctx, "example", &globalaccelerator.CustomRoutingAcceleratorArgs{
    			Name:          pulumi.String("Example"),
    			IpAddressType: pulumi.String("IPV4"),
    			Enabled:       pulumi.Bool(true),
    			Attributes: &globalaccelerator.CustomRoutingAcceleratorAttributesArgs{
    				FlowLogsEnabled:  pulumi.Bool(true),
    				FlowLogsS3Bucket: pulumi.String("example-bucket"),
    				FlowLogsS3Prefix: pulumi.String("flow-logs/"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = globalaccelerator.NewCustomRoutingListener(ctx, "example", &globalaccelerator.CustomRoutingListenerArgs{
    			AcceleratorArn: example.ID(),
    			PortRanges: globalaccelerator.CustomRoutingListenerPortRangeArray{
    				&globalaccelerator.CustomRoutingListenerPortRangeArgs{
    					FromPort: pulumi.Int(80),
    					ToPort:   pulumi.Int(80),
    				},
    			},
    		})
    		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 = new Aws.GlobalAccelerator.CustomRoutingAccelerator("example", new()
        {
            Name = "Example",
            IpAddressType = "IPV4",
            Enabled = true,
            Attributes = new Aws.GlobalAccelerator.Inputs.CustomRoutingAcceleratorAttributesArgs
            {
                FlowLogsEnabled = true,
                FlowLogsS3Bucket = "example-bucket",
                FlowLogsS3Prefix = "flow-logs/",
            },
        });
    
        var exampleCustomRoutingListener = new Aws.GlobalAccelerator.CustomRoutingListener("example", new()
        {
            AcceleratorArn = example.Id,
            PortRanges = new[]
            {
                new Aws.GlobalAccelerator.Inputs.CustomRoutingListenerPortRangeArgs
                {
                    FromPort = 80,
                    ToPort = 80,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.globalaccelerator.CustomRoutingAccelerator;
    import com.pulumi.aws.globalaccelerator.CustomRoutingAcceleratorArgs;
    import com.pulumi.aws.globalaccelerator.inputs.CustomRoutingAcceleratorAttributesArgs;
    import com.pulumi.aws.globalaccelerator.CustomRoutingListener;
    import com.pulumi.aws.globalaccelerator.CustomRoutingListenerArgs;
    import com.pulumi.aws.globalaccelerator.inputs.CustomRoutingListenerPortRangeArgs;
    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 CustomRoutingAccelerator("example", CustomRoutingAcceleratorArgs.builder()
                .name("Example")
                .ipAddressType("IPV4")
                .enabled(true)
                .attributes(CustomRoutingAcceleratorAttributesArgs.builder()
                    .flowLogsEnabled(true)
                    .flowLogsS3Bucket("example-bucket")
                    .flowLogsS3Prefix("flow-logs/")
                    .build())
                .build());
    
            var exampleCustomRoutingListener = new CustomRoutingListener("exampleCustomRoutingListener", CustomRoutingListenerArgs.builder()
                .acceleratorArn(example.id())
                .portRanges(CustomRoutingListenerPortRangeArgs.builder()
                    .fromPort(80)
                    .toPort(80)
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:globalaccelerator:CustomRoutingAccelerator
        properties:
          name: Example
          ipAddressType: IPV4
          enabled: true
          attributes:
            flowLogsEnabled: true
            flowLogsS3Bucket: example-bucket
            flowLogsS3Prefix: flow-logs/
      exampleCustomRoutingListener:
        type: aws:globalaccelerator:CustomRoutingListener
        name: example
        properties:
          acceleratorArn: ${example.id}
          portRanges:
            - fromPort: 80
              toPort: 80
    

    Create CustomRoutingListener Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CustomRoutingListener(name: string, args: CustomRoutingListenerArgs, opts?: CustomResourceOptions);
    @overload
    def CustomRoutingListener(resource_name: str,
                              args: CustomRoutingListenerArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomRoutingListener(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              accelerator_arn: Optional[str] = None,
                              port_ranges: Optional[Sequence[CustomRoutingListenerPortRangeArgs]] = None)
    func NewCustomRoutingListener(ctx *Context, name string, args CustomRoutingListenerArgs, opts ...ResourceOption) (*CustomRoutingListener, error)
    public CustomRoutingListener(string name, CustomRoutingListenerArgs args, CustomResourceOptions? opts = null)
    public CustomRoutingListener(String name, CustomRoutingListenerArgs args)
    public CustomRoutingListener(String name, CustomRoutingListenerArgs args, CustomResourceOptions options)
    
    type: aws:globalaccelerator:CustomRoutingListener
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CustomRoutingListenerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CustomRoutingListenerArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CustomRoutingListenerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomRoutingListenerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomRoutingListenerArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var customRoutingListenerResource = new Aws.GlobalAccelerator.CustomRoutingListener("customRoutingListenerResource", new()
    {
        AcceleratorArn = "string",
        PortRanges = new[]
        {
            new Aws.GlobalAccelerator.Inputs.CustomRoutingListenerPortRangeArgs
            {
                FromPort = 0,
                ToPort = 0,
            },
        },
    });
    
    example, err := globalaccelerator.NewCustomRoutingListener(ctx, "customRoutingListenerResource", &globalaccelerator.CustomRoutingListenerArgs{
    	AcceleratorArn: pulumi.String("string"),
    	PortRanges: globalaccelerator.CustomRoutingListenerPortRangeArray{
    		&globalaccelerator.CustomRoutingListenerPortRangeArgs{
    			FromPort: pulumi.Int(0),
    			ToPort:   pulumi.Int(0),
    		},
    	},
    })
    
    var customRoutingListenerResource = new CustomRoutingListener("customRoutingListenerResource", CustomRoutingListenerArgs.builder()
        .acceleratorArn("string")
        .portRanges(CustomRoutingListenerPortRangeArgs.builder()
            .fromPort(0)
            .toPort(0)
            .build())
        .build());
    
    custom_routing_listener_resource = aws.globalaccelerator.CustomRoutingListener("customRoutingListenerResource",
        accelerator_arn="string",
        port_ranges=[{
            "from_port": 0,
            "to_port": 0,
        }])
    
    const customRoutingListenerResource = new aws.globalaccelerator.CustomRoutingListener("customRoutingListenerResource", {
        acceleratorArn: "string",
        portRanges: [{
            fromPort: 0,
            toPort: 0,
        }],
    });
    
    type: aws:globalaccelerator:CustomRoutingListener
    properties:
        acceleratorArn: string
        portRanges:
            - fromPort: 0
              toPort: 0
    

    CustomRoutingListener Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CustomRoutingListener resource accepts the following input properties:

    AcceleratorArn string
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    PortRanges List<CustomRoutingListenerPortRange>
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    AcceleratorArn string
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    PortRanges []CustomRoutingListenerPortRangeArgs
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    acceleratorArn String
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    portRanges List<CustomRoutingListenerPortRange>
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    acceleratorArn string
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    portRanges CustomRoutingListenerPortRange[]
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    accelerator_arn str
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    port_ranges Sequence[CustomRoutingListenerPortRangeArgs]
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    acceleratorArn String
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    portRanges List<Property Map>
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CustomRoutingListener 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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CustomRoutingListener Resource

    Get an existing CustomRoutingListener 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?: CustomRoutingListenerState, opts?: CustomResourceOptions): CustomRoutingListener
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accelerator_arn: Optional[str] = None,
            port_ranges: Optional[Sequence[CustomRoutingListenerPortRangeArgs]] = None) -> CustomRoutingListener
    func GetCustomRoutingListener(ctx *Context, name string, id IDInput, state *CustomRoutingListenerState, opts ...ResourceOption) (*CustomRoutingListener, error)
    public static CustomRoutingListener Get(string name, Input<string> id, CustomRoutingListenerState? state, CustomResourceOptions? opts = null)
    public static CustomRoutingListener get(String name, Output<String> id, CustomRoutingListenerState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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 a custom routing accelerator.
    PortRanges List<CustomRoutingListenerPortRange>
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    AcceleratorArn string
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    PortRanges []CustomRoutingListenerPortRangeArgs
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    acceleratorArn String
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    portRanges List<CustomRoutingListenerPortRange>
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    acceleratorArn string
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    portRanges CustomRoutingListenerPortRange[]
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    accelerator_arn str
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    port_ranges Sequence[CustomRoutingListenerPortRangeArgs]
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.
    acceleratorArn String
    The Amazon Resource Name (ARN) of a custom routing accelerator.
    portRanges List<Property Map>
    The list of port ranges for the connections from clients to the accelerator. Fields documented below.

    Supporting Types

    CustomRoutingListenerPortRange, CustomRoutingListenerPortRangeArgs

    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 Integer
    The first port in the range of ports, inclusive.
    toPort Integer
    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 int
    The first port in the range of ports, inclusive.
    to_port 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.

    Import

    Using pulumi import, import Global Accelerator custom routing listeners using the id. For example:

    $ pulumi import aws:globalaccelerator/customRoutingListener:CustomRoutingListener example arn:aws:globalaccelerator::111111111111:accelerator/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/listener/xxxxxxxx
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi