unifi logo
Unifi v0.0.3, Dec 5 22

unifi.StaticRoute

unifi.StaticRoute manages a static route.

Example Usage

using System.Collections.Generic;
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",
        Distance = 1,
        NextHop = "172.16.0.1",
    });

    var blackhole = new Unifi.StaticRoute("blackhole", new()
    {
        Type = "blackhole",
        Network = @var.Blackhole_cidr,
        Distance = 1,
    });

    var @interface = new Unifi.StaticRoute("interface", new()
    {
        Type = "interface-route",
        Network = @var.Wan2_cidr,
        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"),
			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(_var.Blackhole_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(_var.Wan2_cidr),
			Distance:  pulumi.Int(1),
			Interface: pulumi.String("WAN2"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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")
            .distance(1)
            .nextHop("172.16.0.1")
            .build());

        var blackhole = new StaticRoute("blackhole", StaticRouteArgs.builder()        
            .type("blackhole")
            .network(var_.blackhole_cidr())
            .distance(1)
            .build());

        var interface_ = new StaticRoute("interface", StaticRouteArgs.builder()        
            .type("interface-route")
            .network(var_.wan2_cidr())
            .distance(1)
            .interface_("WAN2")
            .build());

    }
}
import pulumi
import pulumiverse_unifi as unifi

nexthop = unifi.StaticRoute("nexthop",
    type="nexthop-route",
    network="172.17.0.0/16",
    distance=1,
    next_hop="172.16.0.1")
blackhole = unifi.StaticRoute("blackhole",
    type="blackhole",
    network=var["blackhole_cidr"],
    distance=1)
interface = unifi.StaticRoute("interface",
    type="interface-route",
    network=var["wan2_cidr"],
    distance=1,
    interface="WAN2")
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",
    distance: 1,
    nextHop: "172.16.0.1",
});
const blackhole = new unifi.StaticRoute("blackhole", {
    type: "blackhole",
    network: _var.blackhole_cidr,
    distance: 1,
});
const _interface = new unifi.StaticRoute("interface", {
    type: "interface-route",
    network: _var.wan2_cidr,
    distance: 1,
    "interface": "WAN2",
});
resources:
  nexthop:
    type: unifi:StaticRoute
    properties:
      type: nexthop-route
      network: 172.17.0.0/16
      distance: 1
      nextHop: 172.16.0.1
  blackhole:
    type: unifi:StaticRoute
    properties:
      type: blackhole
      network: ${var.blackhole_cidr}
      distance: 1
  interface:
    type: unifi:StaticRoute
    properties:
      type: interface-route
      network: ${var.wan2_cidr}
      distance: 1
      interface: WAN2

Create StaticRoute Resource

new StaticRoute(name: string, args: StaticRouteArgs, opts?: CustomResourceOptions);
@overload
def StaticRoute(resource_name: 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)
@overload
def StaticRoute(resource_name: str,
                args: StaticRouteArgs,
                opts: Optional[ResourceOptions] = 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.

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.

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

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, or blackhole.

Interface string

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

Interface string

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

interface_ String

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

interface string

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

interface str

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

interface String

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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) -> StaticRoute
func 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)
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:
Distance int

The distance of the static route.

Interface string

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

Distance int

The distance of the static route.

Interface string

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

distance Integer

The distance of the static route.

interface_ String

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

distance number

The distance of the static route.

interface string

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

distance int

The distance of the static route.

interface str

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

distance Number

The distance of the static route.

interface String

The interface of the static route (only valid for interface-route type). This can be WAN1, 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-route type).

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, or blackhole.

Package Details

Repository
unifi pulumiverse/pulumi-unifi
License
Apache-2.0
Notes

This Pulumi package is based on the unifi Terraform Provider.