unifi.StaticRoute
Explore with Pulumi AI
unifi.StaticRoute manages a static route.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as unifi from "@pulumiverse/unifi";
const nexthop = new unifi.StaticRoute("nexthop", {
    type: "nexthop-route",
    network: "172.17.0.0/16",
    name: "basic nexthop",
    distance: 1,
    nextHop: "172.16.0.1",
});
const blackhole = new unifi.StaticRoute("blackhole", {
    type: "blackhole",
    network: blackholeCidr,
    name: "blackhole traffice to cidr",
    distance: 1,
});
const _interface = new unifi.StaticRoute("interface", {
    type: "interface-route",
    network: wan2Cidr,
    name: "send traffic over wan2",
    distance: 1,
    "interface": "WAN2",
});
import pulumi
import pulumiverse_unifi as unifi
nexthop = unifi.StaticRoute("nexthop",
    type="nexthop-route",
    network="172.17.0.0/16",
    name="basic nexthop",
    distance=1,
    next_hop="172.16.0.1")
blackhole = unifi.StaticRoute("blackhole",
    type="blackhole",
    network=blackhole_cidr,
    name="blackhole traffice to cidr",
    distance=1)
interface = unifi.StaticRoute("interface",
    type="interface-route",
    network=wan2_cidr,
    name="send traffic over wan2",
    distance=1,
    interface="WAN2")
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-unifi/sdk/go/unifi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := unifi.NewStaticRoute(ctx, "nexthop", &unifi.StaticRouteArgs{
			Type:     pulumi.String("nexthop-route"),
			Network:  pulumi.String("172.17.0.0/16"),
			Name:     pulumi.String("basic nexthop"),
			Distance: pulumi.Int(1),
			NextHop:  pulumi.String("172.16.0.1"),
		})
		if err != nil {
			return err
		}
		_, err = unifi.NewStaticRoute(ctx, "blackhole", &unifi.StaticRouteArgs{
			Type:     pulumi.String("blackhole"),
			Network:  pulumi.Any(blackholeCidr),
			Name:     pulumi.String("blackhole traffice to cidr"),
			Distance: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		_, err = unifi.NewStaticRoute(ctx, "interface", &unifi.StaticRouteArgs{
			Type:      pulumi.String("interface-route"),
			Network:   pulumi.Any(wan2Cidr),
			Name:      pulumi.String("send traffic over wan2"),
			Distance:  pulumi.Int(1),
			Interface: pulumi.String("WAN2"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Unifi = Pulumiverse.Unifi;
return await Deployment.RunAsync(() => 
{
    var nexthop = new Unifi.StaticRoute("nexthop", new()
    {
        Type = "nexthop-route",
        Network = "172.17.0.0/16",
        Name = "basic nexthop",
        Distance = 1,
        NextHop = "172.16.0.1",
    });
    var blackhole = new Unifi.StaticRoute("blackhole", new()
    {
        Type = "blackhole",
        Network = blackholeCidr,
        Name = "blackhole traffice to cidr",
        Distance = 1,
    });
    var @interface = new Unifi.StaticRoute("interface", new()
    {
        Type = "interface-route",
        Network = wan2Cidr,
        Name = "send traffic over wan2",
        Distance = 1,
        Interface = "WAN2",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.unifi.StaticRoute;
import com.pulumi.unifi.StaticRouteArgs;
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 nexthop = new StaticRoute("nexthop", StaticRouteArgs.builder()
            .type("nexthop-route")
            .network("172.17.0.0/16")
            .name("basic nexthop")
            .distance(1)
            .nextHop("172.16.0.1")
            .build());
        var blackhole = new StaticRoute("blackhole", StaticRouteArgs.builder()
            .type("blackhole")
            .network(blackholeCidr)
            .name("blackhole traffice to cidr")
            .distance(1)
            .build());
        var interface_ = new StaticRoute("interface", StaticRouteArgs.builder()
            .type("interface-route")
            .network(wan2Cidr)
            .name("send traffic over wan2")
            .distance(1)
            .interface_("WAN2")
            .build());
    }
}
resources:
  nexthop:
    type: unifi:StaticRoute
    properties:
      type: nexthop-route
      network: 172.17.0.0/16
      name: basic nexthop
      distance: 1
      nextHop: 172.16.0.1
  blackhole:
    type: unifi:StaticRoute
    properties:
      type: blackhole
      network: ${blackholeCidr}
      name: blackhole traffice to cidr
      distance: 1
  interface:
    type: unifi:StaticRoute
    properties:
      type: interface-route
      network: ${wan2Cidr}
      name: send traffic over wan2
      distance: 1
      interface: WAN2
Create StaticRoute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new StaticRoute(name: string, args: StaticRouteArgs, opts?: CustomResourceOptions);@overload
def StaticRoute(resource_name: str,
                args: StaticRouteArgs,
                opts: Optional[ResourceOptions] = None)
@overload
def StaticRoute(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                distance: Optional[int] = None,
                network: Optional[str] = None,
                type: Optional[str] = None,
                interface: Optional[str] = None,
                name: Optional[str] = None,
                next_hop: Optional[str] = None,
                site: Optional[str] = None)func NewStaticRoute(ctx *Context, name string, args StaticRouteArgs, opts ...ResourceOption) (*StaticRoute, error)public StaticRoute(string name, StaticRouteArgs args, CustomResourceOptions? opts = null)
public StaticRoute(String name, StaticRouteArgs args)
public StaticRoute(String name, StaticRouteArgs args, CustomResourceOptions options)
type: unifi:StaticRoute
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 StaticRouteArgs
- 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 StaticRouteArgs
- 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 StaticRouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args StaticRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args StaticRouteArgs
- 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 staticRouteResource = new Unifi.StaticRoute("staticRouteResource", new()
{
    Distance = 0,
    Network = "string",
    Type = "string",
    Interface = "string",
    Name = "string",
    NextHop = "string",
    Site = "string",
});
example, err := unifi.NewStaticRoute(ctx, "staticRouteResource", &unifi.StaticRouteArgs{
	Distance:  pulumi.Int(0),
	Network:   pulumi.String("string"),
	Type:      pulumi.String("string"),
	Interface: pulumi.String("string"),
	Name:      pulumi.String("string"),
	NextHop:   pulumi.String("string"),
	Site:      pulumi.String("string"),
})
var staticRouteResource = new StaticRoute("staticRouteResource", StaticRouteArgs.builder()
    .distance(0)
    .network("string")
    .type("string")
    .interface_("string")
    .name("string")
    .nextHop("string")
    .site("string")
    .build());
static_route_resource = unifi.StaticRoute("staticRouteResource",
    distance=0,
    network="string",
    type="string",
    interface="string",
    name="string",
    next_hop="string",
    site="string")
const staticRouteResource = new unifi.StaticRoute("staticRouteResource", {
    distance: 0,
    network: "string",
    type: "string",
    "interface": "string",
    name: "string",
    nextHop: "string",
    site: "string",
});
type: unifi:StaticRoute
properties:
    distance: 0
    interface: string
    name: string
    network: string
    nextHop: string
    site: string
    type: string
StaticRoute 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 StaticRoute resource accepts the following input properties:
- Distance int
- The distance of the static route.
- Network string
- The network subnet address.
- Type string
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- Interface string
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- Name string
- The name of the static route.
- NextHop string
- The next hop of the static route (only valid for nexthop-routetype).
- Site string
- The name of the site to associate the static route with.
- Distance int
- The distance of the static route.
- Network string
- The network subnet address.
- Type string
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- Interface string
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- Name string
- The name of the static route.
- NextHop string
- The next hop of the static route (only valid for nexthop-routetype).
- Site string
- The name of the site to associate the static route with.
- distance Integer
- The distance of the static route.
- network String
- The network subnet address.
- type String
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- interface_ String
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- name String
- The name of the static route.
- nextHop String
- The next hop of the static route (only valid for nexthop-routetype).
- site String
- The name of the site to associate the static route with.
- distance number
- The distance of the static route.
- network string
- The network subnet address.
- type string
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- interface string
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- name string
- The name of the static route.
- nextHop string
- The next hop of the static route (only valid for nexthop-routetype).
- site string
- The name of the site to associate the static route with.
- distance int
- The distance of the static route.
- network str
- The network subnet address.
- type str
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- interface str
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- name str
- The name of the static route.
- next_hop str
- The next hop of the static route (only valid for nexthop-routetype).
- site str
- The name of the site to associate the static route with.
- distance Number
- The distance of the static route.
- network String
- The network subnet address.
- type String
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- interface String
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- name String
- The name of the static route.
- nextHop String
- The next hop of the static route (only valid for nexthop-routetype).
- site String
- The name of the site to associate the static route with.
Outputs
All input properties are implicitly available as output properties. Additionally, the StaticRoute 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 StaticRoute Resource
Get an existing StaticRoute 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?: StaticRouteState, opts?: CustomResourceOptions): StaticRoute@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        distance: Optional[int] = None,
        interface: Optional[str] = None,
        name: Optional[str] = None,
        network: Optional[str] = None,
        next_hop: Optional[str] = None,
        site: Optional[str] = None,
        type: Optional[str] = None) -> StaticRoutefunc GetStaticRoute(ctx *Context, name string, id IDInput, state *StaticRouteState, opts ...ResourceOption) (*StaticRoute, error)public static StaticRoute Get(string name, Input<string> id, StaticRouteState? state, CustomResourceOptions? opts = null)public static StaticRoute get(String name, Output<String> id, StaticRouteState state, CustomResourceOptions options)resources:  _:    type: unifi:StaticRoute    get:      id: ${id}- 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.
- Distance int
- The distance of the static route.
- Interface string
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- Name string
- The name of the static route.
- Network string
- The network subnet address.
- NextHop string
- The next hop of the static route (only valid for nexthop-routetype).
- Site string
- The name of the site to associate the static route with.
- Type string
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- Distance int
- The distance of the static route.
- Interface string
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- Name string
- The name of the static route.
- Network string
- The network subnet address.
- NextHop string
- The next hop of the static route (only valid for nexthop-routetype).
- Site string
- The name of the site to associate the static route with.
- Type string
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- distance Integer
- The distance of the static route.
- interface_ String
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- name String
- The name of the static route.
- network String
- The network subnet address.
- nextHop String
- The next hop of the static route (only valid for nexthop-routetype).
- site String
- The name of the site to associate the static route with.
- type String
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- distance number
- The distance of the static route.
- interface string
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- name string
- The name of the static route.
- network string
- The network subnet address.
- nextHop string
- The next hop of the static route (only valid for nexthop-routetype).
- site string
- The name of the site to associate the static route with.
- type string
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- distance int
- The distance of the static route.
- interface str
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- name str
- The name of the static route.
- network str
- The network subnet address.
- next_hop str
- The next hop of the static route (only valid for nexthop-routetype).
- site str
- The name of the site to associate the static route with.
- type str
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
- distance Number
- The distance of the static route.
- interface String
- The interface of the static route (only valid for interface-routetype). This can beWAN1,WAN2, or a network ID.
- name String
- The name of the static route.
- network String
- The network subnet address.
- nextHop String
- The next hop of the static route (only valid for nexthop-routetype).
- site String
- The name of the site to associate the static route with.
- type String
- The type of static route. Can be interface-route,nexthop-route, orblackhole.
Package Details
- Repository
- unifi pulumiverse/pulumi-unifi
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the unifiTerraform Provider.