1. Packages
  2. Kong
  3. API Docs
  4. Route
Kong v4.5.4 published on Monday, Jun 24, 2024 by Pulumi

kong.Route

Explore with Pulumi AI

kong logo
Kong v4.5.4 published on Monday, Jun 24, 2024 by Pulumi

    # kong.Route

    The route resource maps directly onto the json for the route endpoint in Kong. For more information on the parameters see the Kong Route create documentation.

    To create a tcp/tls route you set sources and destinations by repeating the corresponding element (source or destination) for each source or destination you want.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as kong from "@pulumi/kong";
    
    const route = new kong.Route("route", {
        name: "MyRoute",
        protocols: [
            "http",
            "https",
        ],
        methods: [
            "GET",
            "POST",
        ],
        hosts: ["example2.com"],
        paths: ["/test"],
        stripPath: false,
        preserveHost: true,
        regexPriority: 1,
        serviceId: service.id,
        headers: [{
            name: "x-test-1",
            values: [
                "a",
                "b",
            ],
        }],
    });
    
    import pulumi
    import pulumi_kong as kong
    
    route = kong.Route("route",
        name="MyRoute",
        protocols=[
            "http",
            "https",
        ],
        methods=[
            "GET",
            "POST",
        ],
        hosts=["example2.com"],
        paths=["/test"],
        strip_path=False,
        preserve_host=True,
        regex_priority=1,
        service_id=service["id"],
        headers=[kong.RouteHeaderArgs(
            name="x-test-1",
            values=[
                "a",
                "b",
            ],
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-kong/sdk/v4/go/kong"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kong.NewRoute(ctx, "route", &kong.RouteArgs{
    			Name: pulumi.String("MyRoute"),
    			Protocols: pulumi.StringArray{
    				pulumi.String("http"),
    				pulumi.String("https"),
    			},
    			Methods: pulumi.StringArray{
    				pulumi.String("GET"),
    				pulumi.String("POST"),
    			},
    			Hosts: pulumi.StringArray{
    				pulumi.String("example2.com"),
    			},
    			Paths: pulumi.StringArray{
    				pulumi.String("/test"),
    			},
    			StripPath:     pulumi.Bool(false),
    			PreserveHost:  pulumi.Bool(true),
    			RegexPriority: pulumi.Int(1),
    			ServiceId:     pulumi.Any(service.Id),
    			Headers: kong.RouteHeaderArray{
    				&kong.RouteHeaderArgs{
    					Name: pulumi.String("x-test-1"),
    					Values: pulumi.StringArray{
    						pulumi.String("a"),
    						pulumi.String("b"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Kong = Pulumi.Kong;
    
    return await Deployment.RunAsync(() => 
    {
        var route = new Kong.Route("route", new()
        {
            Name = "MyRoute",
            Protocols = new[]
            {
                "http",
                "https",
            },
            Methods = new[]
            {
                "GET",
                "POST",
            },
            Hosts = new[]
            {
                "example2.com",
            },
            Paths = new[]
            {
                "/test",
            },
            StripPath = false,
            PreserveHost = true,
            RegexPriority = 1,
            ServiceId = service.Id,
            Headers = new[]
            {
                new Kong.Inputs.RouteHeaderArgs
                {
                    Name = "x-test-1",
                    Values = new[]
                    {
                        "a",
                        "b",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.kong.Route;
    import com.pulumi.kong.RouteArgs;
    import com.pulumi.kong.inputs.RouteHeaderArgs;
    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 route = new Route("route", RouteArgs.builder()
                .name("MyRoute")
                .protocols(            
                    "http",
                    "https")
                .methods(            
                    "GET",
                    "POST")
                .hosts("example2.com")
                .paths("/test")
                .stripPath(false)
                .preserveHost(true)
                .regexPriority(1)
                .serviceId(service.id())
                .headers(RouteHeaderArgs.builder()
                    .name("x-test-1")
                    .values(                
                        "a",
                        "b")
                    .build())
                .build());
    
        }
    }
    
    resources:
      route:
        type: kong:Route
        properties:
          name: MyRoute
          protocols:
            - http
            - https
          methods:
            - GET
            - POST
          hosts:
            - example2.com
          paths:
            - /test
          stripPath: false
          preserveHost: true
          regexPriority: 1
          serviceId: ${service.id}
          headers:
            - name: x-test-1
              values:
                - a
                - b
    

    To create a tcp/tls route you set sources and destinations by repeating the corresponding element (source or destination) for each source or destination you want, for example:

    import * as pulumi from "@pulumi/pulumi";
    import * as kong from "@pulumi/kong";
    
    const route = new kong.Route("route", {
        protocols: ["tcp"],
        stripPath: true,
        preserveHost: false,
        sources: [
            {
                ip: "192.168.1.1",
                port: 80,
            },
            {
                ip: "192.168.1.2",
            },
        ],
        destinations: [{
            ip: "172.10.1.1",
            port: 81,
        }],
        snis: ["foo.com"],
        serviceId: service.id,
    });
    
    import pulumi
    import pulumi_kong as kong
    
    route = kong.Route("route",
        protocols=["tcp"],
        strip_path=True,
        preserve_host=False,
        sources=[
            kong.RouteSourceArgs(
                ip="192.168.1.1",
                port=80,
            ),
            kong.RouteSourceArgs(
                ip="192.168.1.2",
            ),
        ],
        destinations=[kong.RouteDestinationArgs(
            ip="172.10.1.1",
            port=81,
        )],
        snis=["foo.com"],
        service_id=service["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-kong/sdk/v4/go/kong"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kong.NewRoute(ctx, "route", &kong.RouteArgs{
    			Protocols: pulumi.StringArray{
    				pulumi.String("tcp"),
    			},
    			StripPath:    pulumi.Bool(true),
    			PreserveHost: pulumi.Bool(false),
    			Sources: kong.RouteSourceArray{
    				&kong.RouteSourceArgs{
    					Ip:   pulumi.String("192.168.1.1"),
    					Port: pulumi.Int(80),
    				},
    				&kong.RouteSourceArgs{
    					Ip: pulumi.String("192.168.1.2"),
    				},
    			},
    			Destinations: kong.RouteDestinationArray{
    				&kong.RouteDestinationArgs{
    					Ip:   pulumi.String("172.10.1.1"),
    					Port: pulumi.Int(81),
    				},
    			},
    			Snis: pulumi.StringArray{
    				pulumi.String("foo.com"),
    			},
    			ServiceId: pulumi.Any(service.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Kong = Pulumi.Kong;
    
    return await Deployment.RunAsync(() => 
    {
        var route = new Kong.Route("route", new()
        {
            Protocols = new[]
            {
                "tcp",
            },
            StripPath = true,
            PreserveHost = false,
            Sources = new[]
            {
                new Kong.Inputs.RouteSourceArgs
                {
                    Ip = "192.168.1.1",
                    Port = 80,
                },
                new Kong.Inputs.RouteSourceArgs
                {
                    Ip = "192.168.1.2",
                },
            },
            Destinations = new[]
            {
                new Kong.Inputs.RouteDestinationArgs
                {
                    Ip = "172.10.1.1",
                    Port = 81,
                },
            },
            Snis = new[]
            {
                "foo.com",
            },
            ServiceId = service.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.kong.Route;
    import com.pulumi.kong.RouteArgs;
    import com.pulumi.kong.inputs.RouteSourceArgs;
    import com.pulumi.kong.inputs.RouteDestinationArgs;
    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 route = new Route("route", RouteArgs.builder()
                .protocols("tcp")
                .stripPath(true)
                .preserveHost(false)
                .sources(            
                    RouteSourceArgs.builder()
                        .ip("192.168.1.1")
                        .port(80)
                        .build(),
                    RouteSourceArgs.builder()
                        .ip("192.168.1.2")
                        .build())
                .destinations(RouteDestinationArgs.builder()
                    .ip("172.10.1.1")
                    .port(81)
                    .build())
                .snis("foo.com")
                .serviceId(service.id())
                .build());
    
        }
    }
    
    resources:
      route:
        type: kong:Route
        properties:
          protocols:
            - tcp
          stripPath: true
          preserveHost: false
          sources:
            - ip: 192.168.1.1
              port: 80
            - ip: 192.168.1.2
          destinations:
            - ip: 172.10.1.1
              port: 81
          snis:
            - foo.com
          serviceId: ${service.id}
    

    Create Route Resource

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

    Constructor syntax

    new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);
    @overload
    def Route(resource_name: str,
              args: RouteArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Route(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              protocols: Optional[Sequence[str]] = None,
              service_id: Optional[str] = None,
              preserve_host: Optional[bool] = None,
              hosts: Optional[Sequence[str]] = None,
              methods: Optional[Sequence[str]] = None,
              name: Optional[str] = None,
              path_handling: Optional[str] = None,
              paths: Optional[Sequence[str]] = None,
              destinations: Optional[Sequence[RouteDestinationArgs]] = None,
              https_redirect_status_code: Optional[int] = None,
              regex_priority: Optional[int] = None,
              request_buffering: Optional[bool] = None,
              response_buffering: Optional[bool] = None,
              headers: Optional[Sequence[RouteHeaderArgs]] = None,
              snis: Optional[Sequence[str]] = None,
              sources: Optional[Sequence[RouteSourceArgs]] = None,
              strip_path: Optional[bool] = None,
              tags: Optional[Sequence[str]] = None)
    func NewRoute(ctx *Context, name string, args RouteArgs, opts ...ResourceOption) (*Route, error)
    public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)
    public Route(String name, RouteArgs args)
    public Route(String name, RouteArgs args, CustomResourceOptions options)
    
    type: kong:Route
    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 RouteArgs
    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 RouteArgs
    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 RouteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RouteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RouteArgs
    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 routeResource = new Kong.Route("routeResource", new()
    {
        Protocols = new[]
        {
            "string",
        },
        ServiceId = "string",
        PreserveHost = false,
        Hosts = new[]
        {
            "string",
        },
        Methods = new[]
        {
            "string",
        },
        Name = "string",
        PathHandling = "string",
        Paths = new[]
        {
            "string",
        },
        Destinations = new[]
        {
            new Kong.Inputs.RouteDestinationArgs
            {
                Ip = "string",
                Port = 0,
            },
        },
        HttpsRedirectStatusCode = 0,
        RegexPriority = 0,
        RequestBuffering = false,
        ResponseBuffering = false,
        Headers = new[]
        {
            new Kong.Inputs.RouteHeaderArgs
            {
                Name = "string",
                Values = new[]
                {
                    "string",
                },
            },
        },
        Snis = new[]
        {
            "string",
        },
        Sources = new[]
        {
            new Kong.Inputs.RouteSourceArgs
            {
                Ip = "string",
                Port = 0,
            },
        },
        StripPath = false,
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := kong.NewRoute(ctx, "routeResource", &kong.RouteArgs{
    	Protocols: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ServiceId:    pulumi.String("string"),
    	PreserveHost: pulumi.Bool(false),
    	Hosts: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Methods: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name:         pulumi.String("string"),
    	PathHandling: pulumi.String("string"),
    	Paths: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Destinations: kong.RouteDestinationArray{
    		&kong.RouteDestinationArgs{
    			Ip:   pulumi.String("string"),
    			Port: pulumi.Int(0),
    		},
    	},
    	HttpsRedirectStatusCode: pulumi.Int(0),
    	RegexPriority:           pulumi.Int(0),
    	RequestBuffering:        pulumi.Bool(false),
    	ResponseBuffering:       pulumi.Bool(false),
    	Headers: kong.RouteHeaderArray{
    		&kong.RouteHeaderArgs{
    			Name: pulumi.String("string"),
    			Values: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	Snis: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Sources: kong.RouteSourceArray{
    		&kong.RouteSourceArgs{
    			Ip:   pulumi.String("string"),
    			Port: pulumi.Int(0),
    		},
    	},
    	StripPath: pulumi.Bool(false),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var routeResource = new Route("routeResource", RouteArgs.builder()
        .protocols("string")
        .serviceId("string")
        .preserveHost(false)
        .hosts("string")
        .methods("string")
        .name("string")
        .pathHandling("string")
        .paths("string")
        .destinations(RouteDestinationArgs.builder()
            .ip("string")
            .port(0)
            .build())
        .httpsRedirectStatusCode(0)
        .regexPriority(0)
        .requestBuffering(false)
        .responseBuffering(false)
        .headers(RouteHeaderArgs.builder()
            .name("string")
            .values("string")
            .build())
        .snis("string")
        .sources(RouteSourceArgs.builder()
            .ip("string")
            .port(0)
            .build())
        .stripPath(false)
        .tags("string")
        .build());
    
    route_resource = kong.Route("routeResource",
        protocols=["string"],
        service_id="string",
        preserve_host=False,
        hosts=["string"],
        methods=["string"],
        name="string",
        path_handling="string",
        paths=["string"],
        destinations=[kong.RouteDestinationArgs(
            ip="string",
            port=0,
        )],
        https_redirect_status_code=0,
        regex_priority=0,
        request_buffering=False,
        response_buffering=False,
        headers=[kong.RouteHeaderArgs(
            name="string",
            values=["string"],
        )],
        snis=["string"],
        sources=[kong.RouteSourceArgs(
            ip="string",
            port=0,
        )],
        strip_path=False,
        tags=["string"])
    
    const routeResource = new kong.Route("routeResource", {
        protocols: ["string"],
        serviceId: "string",
        preserveHost: false,
        hosts: ["string"],
        methods: ["string"],
        name: "string",
        pathHandling: "string",
        paths: ["string"],
        destinations: [{
            ip: "string",
            port: 0,
        }],
        httpsRedirectStatusCode: 0,
        regexPriority: 0,
        requestBuffering: false,
        responseBuffering: false,
        headers: [{
            name: "string",
            values: ["string"],
        }],
        snis: ["string"],
        sources: [{
            ip: "string",
            port: 0,
        }],
        stripPath: false,
        tags: ["string"],
    });
    
    type: kong:Route
    properties:
        destinations:
            - ip: string
              port: 0
        headers:
            - name: string
              values:
                - string
        hosts:
            - string
        httpsRedirectStatusCode: 0
        methods:
            - string
        name: string
        pathHandling: string
        paths:
            - string
        preserveHost: false
        protocols:
            - string
        regexPriority: 0
        requestBuffering: false
        responseBuffering: false
        serviceId: string
        snis:
            - string
        sources:
            - ip: string
              port: 0
        stripPath: false
        tags:
            - string
    

    Route Resource Properties

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

    Inputs

    The Route resource accepts the following input properties:

    Protocols List<string>
    The list of protocols to use
    ServiceId string
    Service ID to map to
    Destinations List<RouteDestination>
    A list of destination ip and port
    Headers List<RouteHeader>
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    Hosts List<string>
    A list of domain names that match this Route
    HttpsRedirectStatusCode int
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    Methods List<string>
    A list of HTTP methods that match this Route
    Name string
    The name of the route
    PathHandling string
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    Paths List<string>
    A list of paths that match this Route
    PreserveHost bool
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    RegexPriority int
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    RequestBuffering bool
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    ResponseBuffering bool
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    Snis List<string>
    A list of SNIs that match this Route when using stream routing.
    Sources List<RouteSource>
    A list of source ip and port
    StripPath bool
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    Tags List<string>
    A list of strings associated with the Route for grouping and filtering.
    Protocols []string
    The list of protocols to use
    ServiceId string
    Service ID to map to
    Destinations []RouteDestinationArgs
    A list of destination ip and port
    Headers []RouteHeaderArgs
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    Hosts []string
    A list of domain names that match this Route
    HttpsRedirectStatusCode int
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    Methods []string
    A list of HTTP methods that match this Route
    Name string
    The name of the route
    PathHandling string
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    Paths []string
    A list of paths that match this Route
    PreserveHost bool
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    RegexPriority int
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    RequestBuffering bool
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    ResponseBuffering bool
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    Snis []string
    A list of SNIs that match this Route when using stream routing.
    Sources []RouteSourceArgs
    A list of source ip and port
    StripPath bool
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    Tags []string
    A list of strings associated with the Route for grouping and filtering.
    protocols List<String>
    The list of protocols to use
    serviceId String
    Service ID to map to
    destinations List<RouteDestination>
    A list of destination ip and port
    headers List<RouteHeader>
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    hosts List<String>
    A list of domain names that match this Route
    httpsRedirectStatusCode Integer
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    methods List<String>
    A list of HTTP methods that match this Route
    name String
    The name of the route
    pathHandling String
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    paths List<String>
    A list of paths that match this Route
    preserveHost Boolean
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    regexPriority Integer
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    requestBuffering Boolean
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    responseBuffering Boolean
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    snis List<String>
    A list of SNIs that match this Route when using stream routing.
    sources List<RouteSource>
    A list of source ip and port
    stripPath Boolean
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    tags List<String>
    A list of strings associated with the Route for grouping and filtering.
    protocols string[]
    The list of protocols to use
    serviceId string
    Service ID to map to
    destinations RouteDestination[]
    A list of destination ip and port
    headers RouteHeader[]
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    hosts string[]
    A list of domain names that match this Route
    httpsRedirectStatusCode number
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    methods string[]
    A list of HTTP methods that match this Route
    name string
    The name of the route
    pathHandling string
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    paths string[]
    A list of paths that match this Route
    preserveHost boolean
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    regexPriority number
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    requestBuffering boolean
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    responseBuffering boolean
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    snis string[]
    A list of SNIs that match this Route when using stream routing.
    sources RouteSource[]
    A list of source ip and port
    stripPath boolean
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    tags string[]
    A list of strings associated with the Route for grouping and filtering.
    protocols Sequence[str]
    The list of protocols to use
    service_id str
    Service ID to map to
    destinations Sequence[RouteDestinationArgs]
    A list of destination ip and port
    headers Sequence[RouteHeaderArgs]
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    hosts Sequence[str]
    A list of domain names that match this Route
    https_redirect_status_code int
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    methods Sequence[str]
    A list of HTTP methods that match this Route
    name str
    The name of the route
    path_handling str
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    paths Sequence[str]
    A list of paths that match this Route
    preserve_host bool
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    regex_priority int
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    request_buffering bool
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    response_buffering bool
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    snis Sequence[str]
    A list of SNIs that match this Route when using stream routing.
    sources Sequence[RouteSourceArgs]
    A list of source ip and port
    strip_path bool
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    tags Sequence[str]
    A list of strings associated with the Route for grouping and filtering.
    protocols List<String>
    The list of protocols to use
    serviceId String
    Service ID to map to
    destinations List<Property Map>
    A list of destination ip and port
    headers List<Property Map>
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    hosts List<String>
    A list of domain names that match this Route
    httpsRedirectStatusCode Number
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    methods List<String>
    A list of HTTP methods that match this Route
    name String
    The name of the route
    pathHandling String
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    paths List<String>
    A list of paths that match this Route
    preserveHost Boolean
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    regexPriority Number
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    requestBuffering Boolean
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    responseBuffering Boolean
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    snis List<String>
    A list of SNIs that match this Route when using stream routing.
    sources List<Property Map>
    A list of source ip and port
    stripPath Boolean
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    tags List<String>
    A list of strings associated with the Route for grouping and filtering.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Route 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 Route Resource

    Get an existing Route 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?: RouteState, opts?: CustomResourceOptions): Route
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            destinations: Optional[Sequence[RouteDestinationArgs]] = None,
            headers: Optional[Sequence[RouteHeaderArgs]] = None,
            hosts: Optional[Sequence[str]] = None,
            https_redirect_status_code: Optional[int] = None,
            methods: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            path_handling: Optional[str] = None,
            paths: Optional[Sequence[str]] = None,
            preserve_host: Optional[bool] = None,
            protocols: Optional[Sequence[str]] = None,
            regex_priority: Optional[int] = None,
            request_buffering: Optional[bool] = None,
            response_buffering: Optional[bool] = None,
            service_id: Optional[str] = None,
            snis: Optional[Sequence[str]] = None,
            sources: Optional[Sequence[RouteSourceArgs]] = None,
            strip_path: Optional[bool] = None,
            tags: Optional[Sequence[str]] = None) -> Route
    func GetRoute(ctx *Context, name string, id IDInput, state *RouteState, opts ...ResourceOption) (*Route, error)
    public static Route Get(string name, Input<string> id, RouteState? state, CustomResourceOptions? opts = null)
    public static Route get(String name, Output<String> id, RouteState 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:
    Destinations List<RouteDestination>
    A list of destination ip and port
    Headers List<RouteHeader>
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    Hosts List<string>
    A list of domain names that match this Route
    HttpsRedirectStatusCode int
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    Methods List<string>
    A list of HTTP methods that match this Route
    Name string
    The name of the route
    PathHandling string
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    Paths List<string>
    A list of paths that match this Route
    PreserveHost bool
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    Protocols List<string>
    The list of protocols to use
    RegexPriority int
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    RequestBuffering bool
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    ResponseBuffering bool
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    ServiceId string
    Service ID to map to
    Snis List<string>
    A list of SNIs that match this Route when using stream routing.
    Sources List<RouteSource>
    A list of source ip and port
    StripPath bool
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    Tags List<string>
    A list of strings associated with the Route for grouping and filtering.
    Destinations []RouteDestinationArgs
    A list of destination ip and port
    Headers []RouteHeaderArgs
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    Hosts []string
    A list of domain names that match this Route
    HttpsRedirectStatusCode int
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    Methods []string
    A list of HTTP methods that match this Route
    Name string
    The name of the route
    PathHandling string
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    Paths []string
    A list of paths that match this Route
    PreserveHost bool
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    Protocols []string
    The list of protocols to use
    RegexPriority int
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    RequestBuffering bool
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    ResponseBuffering bool
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    ServiceId string
    Service ID to map to
    Snis []string
    A list of SNIs that match this Route when using stream routing.
    Sources []RouteSourceArgs
    A list of source ip and port
    StripPath bool
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    Tags []string
    A list of strings associated with the Route for grouping and filtering.
    destinations List<RouteDestination>
    A list of destination ip and port
    headers List<RouteHeader>
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    hosts List<String>
    A list of domain names that match this Route
    httpsRedirectStatusCode Integer
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    methods List<String>
    A list of HTTP methods that match this Route
    name String
    The name of the route
    pathHandling String
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    paths List<String>
    A list of paths that match this Route
    preserveHost Boolean
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    protocols List<String>
    The list of protocols to use
    regexPriority Integer
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    requestBuffering Boolean
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    responseBuffering Boolean
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    serviceId String
    Service ID to map to
    snis List<String>
    A list of SNIs that match this Route when using stream routing.
    sources List<RouteSource>
    A list of source ip and port
    stripPath Boolean
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    tags List<String>
    A list of strings associated with the Route for grouping and filtering.
    destinations RouteDestination[]
    A list of destination ip and port
    headers RouteHeader[]
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    hosts string[]
    A list of domain names that match this Route
    httpsRedirectStatusCode number
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    methods string[]
    A list of HTTP methods that match this Route
    name string
    The name of the route
    pathHandling string
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    paths string[]
    A list of paths that match this Route
    preserveHost boolean
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    protocols string[]
    The list of protocols to use
    regexPriority number
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    requestBuffering boolean
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    responseBuffering boolean
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    serviceId string
    Service ID to map to
    snis string[]
    A list of SNIs that match this Route when using stream routing.
    sources RouteSource[]
    A list of source ip and port
    stripPath boolean
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    tags string[]
    A list of strings associated with the Route for grouping and filtering.
    destinations Sequence[RouteDestinationArgs]
    A list of destination ip and port
    headers Sequence[RouteHeaderArgs]
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    hosts Sequence[str]
    A list of domain names that match this Route
    https_redirect_status_code int
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    methods Sequence[str]
    A list of HTTP methods that match this Route
    name str
    The name of the route
    path_handling str
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    paths Sequence[str]
    A list of paths that match this Route
    preserve_host bool
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    protocols Sequence[str]
    The list of protocols to use
    regex_priority int
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    request_buffering bool
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    response_buffering bool
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    service_id str
    Service ID to map to
    snis Sequence[str]
    A list of SNIs that match this Route when using stream routing.
    sources Sequence[RouteSourceArgs]
    A list of source ip and port
    strip_path bool
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    tags Sequence[str]
    A list of strings associated with the Route for grouping and filtering.
    destinations List<Property Map>
    A list of destination ip and port
    headers List<Property Map>
    One or more blocks of name to set name of header and values which is a list of string for the header values to match on. See above example of how to set. These headers will cause this Route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute.
    hosts List<String>
    A list of domain names that match this Route
    httpsRedirectStatusCode Number
    The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Accepted values are: 426, 301, 302, 307, 308. Default: 426.
    methods List<String>
    A list of HTTP methods that match this Route
    name String
    The name of the route
    pathHandling String
    Controls how the Service path, Route path and requested path are combined when sending a request to the upstream.
    paths List<String>
    A list of paths that match this Route
    preserveHost Boolean
    When matching a Route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the Service’s host.
    protocols List<String>
    The list of protocols to use
    regexPriority Number
    A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
    requestBuffering Boolean
    Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. Default: true.
    responseBuffering Boolean
    Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. Default: true.
    serviceId String
    Service ID to map to
    snis List<String>
    A list of SNIs that match this Route when using stream routing.
    sources List<Property Map>
    A list of source ip and port
    stripPath Boolean
    When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.
    tags List<String>
    A list of strings associated with the Route for grouping and filtering.

    Supporting Types

    RouteDestination, RouteDestinationArgs

    Ip string
    Port int
    Ip string
    Port int
    ip String
    port Integer
    ip string
    port number
    ip str
    port int
    ip String
    port Number

    RouteHeader, RouteHeaderArgs

    Name string
    The name of the route
    Values List<string>
    Name string
    The name of the route
    Values []string
    name String
    The name of the route
    values List<String>
    name string
    The name of the route
    values string[]
    name str
    The name of the route
    values Sequence[str]
    name String
    The name of the route
    values List<String>

    RouteSource, RouteSourceArgs

    Ip string
    Port int
    Ip string
    Port int
    ip String
    port Integer
    ip string
    port number
    ip str
    port int
    ip String
    port Number

    Import

    To import a route:

    $ pulumi import kong:index/route:Route <route_identifier> <route_id>
    

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

    Package Details

    Repository
    Kong pulumi/pulumi-kong
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the kong Terraform Provider.
    kong logo
    Kong v4.5.4 published on Monday, Jun 24, 2024 by Pulumi