1. Packages
  2. Nutanix
  3. API Docs
  4. StaticRoutes
Nutanix v0.7.4 published on Friday, Mar 21, 2025 by Piers Karsenbarg

nutanix.StaticRoutes

Explore with Pulumi AI

Provides Nutanix resource to create Static Routes within VPCs.

create one static route for vpc uuid with external subnet

import * as pulumi from "@pulumi/pulumi";
import * as nutanix from "@pierskarsenbarg/nutanix";

const scn = new nutanix.StaticRoutes("scn", {
    staticRoutesLists: [{
        destination: "10.x.x.x/x",
        externalSubnetReferenceUuid: "{{ext_subnet_uuid}}",
    }],
    vpcUuid: "{{vpc_uuid}}",
});
Copy
import pulumi
import pulumi_nutanix as nutanix

scn = nutanix.StaticRoutes("scn",
    static_routes_lists=[{
        "destination": "10.x.x.x/x",
        "external_subnet_reference_uuid": "{{ext_subnet_uuid}}",
    }],
    vpc_uuid="{{vpc_uuid}}")
Copy
package main

import (
	"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nutanix.NewStaticRoutes(ctx, "scn", &nutanix.StaticRoutesArgs{
			StaticRoutesLists: nutanix.StaticRoutesStaticRoutesListArray{
				&nutanix.StaticRoutesStaticRoutesListArgs{
					Destination:                 pulumi.String("10.x.x.x/x"),
					ExternalSubnetReferenceUuid: pulumi.String("{{ext_subnet_uuid}}"),
				},
			},
			VpcUuid: pulumi.String("{{vpc_uuid}}"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nutanix = PiersKarsenbarg.Nutanix;

return await Deployment.RunAsync(() => 
{
    var scn = new Nutanix.StaticRoutes("scn", new()
    {
        StaticRoutesLists = new[]
        {
            new Nutanix.Inputs.StaticRoutesStaticRoutesListArgs
            {
                Destination = "10.x.x.x/x",
                ExternalSubnetReferenceUuid = "{{ext_subnet_uuid}}",
            },
        },
        VpcUuid = "{{vpc_uuid}}",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nutanix.StaticRoutes;
import com.pulumi.nutanix.StaticRoutesArgs;
import com.pulumi.nutanix.inputs.StaticRoutesStaticRoutesListArgs;
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 scn = new StaticRoutes("scn", StaticRoutesArgs.builder()
            .staticRoutesLists(StaticRoutesStaticRoutesListArgs.builder()
                .destination("10.x.x.x/x")
                .externalSubnetReferenceUuid("{{ext_subnet_uuid}}")
                .build())
            .vpcUuid("{{vpc_uuid}}")
            .build());

    }
}
Copy
resources:
  scn:
    type: nutanix:StaticRoutes
    properties:
      staticRoutesLists:
        - destination: 10.x.x.x/x
          externalSubnetReferenceUuid: '{{ext_subnet_uuid}}'
      vpcUuid: '{{vpc_uuid}}'
Copy

create one static route with default route for vpc name with external subnet

import * as pulumi from "@pulumi/pulumi";
import * as nutanix from "@pierskarsenbarg/nutanix";

const scn = new nutanix.StaticRoutes("scn", {
    defaultRouteNexthops: [{
        externalSubnetReferenceUuid: "{{ext_subnet_uuid}}",
    }],
    staticRoutesLists: [{
        destination: "10.x.x.x/x",
        externalSubnetReferenceUuid: "{{ext_subnet_uuid}}",
    }],
    vpcName: "{{vpc_name}}",
});
Copy
import pulumi
import pulumi_nutanix as nutanix

scn = nutanix.StaticRoutes("scn",
    default_route_nexthops=[{
        "external_subnet_reference_uuid": "{{ext_subnet_uuid}}",
    }],
    static_routes_lists=[{
        "destination": "10.x.x.x/x",
        "external_subnet_reference_uuid": "{{ext_subnet_uuid}}",
    }],
    vpc_name="{{vpc_name}}")
Copy
package main

import (
	"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nutanix.NewStaticRoutes(ctx, "scn", &nutanix.StaticRoutesArgs{
			DefaultRouteNexthops: nutanix.StaticRoutesDefaultRouteNexthopArray{
				&nutanix.StaticRoutesDefaultRouteNexthopArgs{
					ExternalSubnetReferenceUuid: pulumi.String("{{ext_subnet_uuid}}"),
				},
			},
			StaticRoutesLists: nutanix.StaticRoutesStaticRoutesListArray{
				&nutanix.StaticRoutesStaticRoutesListArgs{
					Destination:                 pulumi.String("10.x.x.x/x"),
					ExternalSubnetReferenceUuid: pulumi.String("{{ext_subnet_uuid}}"),
				},
			},
			VpcName: pulumi.String("{{vpc_name}}"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nutanix = PiersKarsenbarg.Nutanix;

return await Deployment.RunAsync(() => 
{
    var scn = new Nutanix.StaticRoutes("scn", new()
    {
        DefaultRouteNexthops = new[]
        {
            new Nutanix.Inputs.StaticRoutesDefaultRouteNexthopArgs
            {
                ExternalSubnetReferenceUuid = "{{ext_subnet_uuid}}",
            },
        },
        StaticRoutesLists = new[]
        {
            new Nutanix.Inputs.StaticRoutesStaticRoutesListArgs
            {
                Destination = "10.x.x.x/x",
                ExternalSubnetReferenceUuid = "{{ext_subnet_uuid}}",
            },
        },
        VpcName = "{{vpc_name}}",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nutanix.StaticRoutes;
import com.pulumi.nutanix.StaticRoutesArgs;
import com.pulumi.nutanix.inputs.StaticRoutesDefaultRouteNexthopArgs;
import com.pulumi.nutanix.inputs.StaticRoutesStaticRoutesListArgs;
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 scn = new StaticRoutes("scn", StaticRoutesArgs.builder()
            .defaultRouteNexthops(StaticRoutesDefaultRouteNexthopArgs.builder()
                .externalSubnetReferenceUuid("{{ext_subnet_uuid}}")
                .build())
            .staticRoutesLists(StaticRoutesStaticRoutesListArgs.builder()
                .destination("10.x.x.x/x")
                .externalSubnetReferenceUuid("{{ext_subnet_uuid}}")
                .build())
            .vpcName("{{vpc_name}}")
            .build());

    }
}
Copy
resources:
  scn:
    type: nutanix:StaticRoutes
    properties:
      defaultRouteNexthops:
        - externalSubnetReferenceUuid: '{{ext_subnet_uuid}}'
      staticRoutesLists:
        - destination: 10.x.x.x/x
          externalSubnetReferenceUuid: '{{ext_subnet_uuid}}'
      vpcName: '{{vpc_name}}'
Copy

Note: destination with 0.0.0.0/0 will be default route.

Create StaticRoutes Resource

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

Constructor syntax

new StaticRoutes(name: string, args?: StaticRoutesArgs, opts?: CustomResourceOptions);
@overload
def StaticRoutes(resource_name: str,
                 args: Optional[StaticRoutesArgs] = None,
                 opts: Optional[ResourceOptions] = None)

@overload
def StaticRoutes(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 api_version: Optional[str] = None,
                 default_route_nexthops: Optional[Sequence[StaticRoutesDefaultRouteNexthopArgs]] = None,
                 static_routes_lists: Optional[Sequence[StaticRoutesStaticRoutesListArgs]] = None,
                 vpc_name: Optional[str] = None,
                 vpc_uuid: Optional[str] = None)
func NewStaticRoutes(ctx *Context, name string, args *StaticRoutesArgs, opts ...ResourceOption) (*StaticRoutes, error)
public StaticRoutes(string name, StaticRoutesArgs? args = null, CustomResourceOptions? opts = null)
public StaticRoutes(String name, StaticRoutesArgs args)
public StaticRoutes(String name, StaticRoutesArgs args, CustomResourceOptions options)
type: nutanix:StaticRoutes
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args StaticRoutesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args StaticRoutesArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args StaticRoutesArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args StaticRoutesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. StaticRoutesArgs
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 staticRoutesResource = new Nutanix.StaticRoutes("staticRoutesResource", new()
{
    ApiVersion = "string",
    DefaultRouteNexthops = new[]
    {
        new Nutanix.Inputs.StaticRoutesDefaultRouteNexthopArgs
        {
            ExternalSubnetReferenceUuid = "string",
        },
    },
    StaticRoutesLists = new[]
    {
        new Nutanix.Inputs.StaticRoutesStaticRoutesListArgs
        {
            Destination = "string",
            ExternalSubnetReferenceUuid = "string",
            VpnConnectionReferenceUuid = "string",
        },
    },
    VpcName = "string",
    VpcUuid = "string",
});
Copy
example, err := nutanix.NewStaticRoutes(ctx, "staticRoutesResource", &nutanix.StaticRoutesArgs{
	ApiVersion: pulumi.String("string"),
	DefaultRouteNexthops: nutanix.StaticRoutesDefaultRouteNexthopArray{
		&nutanix.StaticRoutesDefaultRouteNexthopArgs{
			ExternalSubnetReferenceUuid: pulumi.String("string"),
		},
	},
	StaticRoutesLists: nutanix.StaticRoutesStaticRoutesListArray{
		&nutanix.StaticRoutesStaticRoutesListArgs{
			Destination:                 pulumi.String("string"),
			ExternalSubnetReferenceUuid: pulumi.String("string"),
			VpnConnectionReferenceUuid:  pulumi.String("string"),
		},
	},
	VpcName: pulumi.String("string"),
	VpcUuid: pulumi.String("string"),
})
Copy
var staticRoutesResource = new StaticRoutes("staticRoutesResource", StaticRoutesArgs.builder()
    .apiVersion("string")
    .defaultRouteNexthops(StaticRoutesDefaultRouteNexthopArgs.builder()
        .externalSubnetReferenceUuid("string")
        .build())
    .staticRoutesLists(StaticRoutesStaticRoutesListArgs.builder()
        .destination("string")
        .externalSubnetReferenceUuid("string")
        .vpnConnectionReferenceUuid("string")
        .build())
    .vpcName("string")
    .vpcUuid("string")
    .build());
Copy
static_routes_resource = nutanix.StaticRoutes("staticRoutesResource",
    api_version="string",
    default_route_nexthops=[{
        "external_subnet_reference_uuid": "string",
    }],
    static_routes_lists=[{
        "destination": "string",
        "external_subnet_reference_uuid": "string",
        "vpn_connection_reference_uuid": "string",
    }],
    vpc_name="string",
    vpc_uuid="string")
Copy
const staticRoutesResource = new nutanix.StaticRoutes("staticRoutesResource", {
    apiVersion: "string",
    defaultRouteNexthops: [{
        externalSubnetReferenceUuid: "string",
    }],
    staticRoutesLists: [{
        destination: "string",
        externalSubnetReferenceUuid: "string",
        vpnConnectionReferenceUuid: "string",
    }],
    vpcName: "string",
    vpcUuid: "string",
});
Copy
type: nutanix:StaticRoutes
properties:
    apiVersion: string
    defaultRouteNexthops:
        - externalSubnetReferenceUuid: string
    staticRoutesLists:
        - destination: string
          externalSubnetReferenceUuid: string
          vpnConnectionReferenceUuid: string
    vpcName: string
    vpcUuid: string
Copy

StaticRoutes 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 StaticRoutes resource accepts the following input properties:

ApiVersion string
The version of the API.
DefaultRouteNexthops List<PiersKarsenbarg.Nutanix.Inputs.StaticRoutesDefaultRouteNexthop>
Default Route
StaticRoutesLists List<PiersKarsenbarg.Nutanix.Inputs.StaticRoutesStaticRoutesList>
Static Routes.
VpcName string
vpc Name. Should not be used with vpc_uuid.
VpcUuid string
Reference to a VPC UUID. Should not be used with vpc_name.
ApiVersion string
The version of the API.
DefaultRouteNexthops []StaticRoutesDefaultRouteNexthopArgs
Default Route
StaticRoutesLists []StaticRoutesStaticRoutesListArgs
Static Routes.
VpcName string
vpc Name. Should not be used with vpc_uuid.
VpcUuid string
Reference to a VPC UUID. Should not be used with vpc_name.
apiVersion String
The version of the API.
defaultRouteNexthops List<StaticRoutesDefaultRouteNexthop>
Default Route
staticRoutesLists List<StaticRoutesStaticRoutesList>
Static Routes.
vpcName String
vpc Name. Should not be used with vpc_uuid.
vpcUuid String
Reference to a VPC UUID. Should not be used with vpc_name.
apiVersion string
The version of the API.
defaultRouteNexthops StaticRoutesDefaultRouteNexthop[]
Default Route
staticRoutesLists StaticRoutesStaticRoutesList[]
Static Routes.
vpcName string
vpc Name. Should not be used with vpc_uuid.
vpcUuid string
Reference to a VPC UUID. Should not be used with vpc_name.
api_version str
The version of the API.
default_route_nexthops Sequence[StaticRoutesDefaultRouteNexthopArgs]
Default Route
static_routes_lists Sequence[StaticRoutesStaticRoutesListArgs]
Static Routes.
vpc_name str
vpc Name. Should not be used with vpc_uuid.
vpc_uuid str
Reference to a VPC UUID. Should not be used with vpc_name.
apiVersion String
The version of the API.
defaultRouteNexthops List<Property Map>
Default Route
staticRoutesLists List<Property Map>
Static Routes.
vpcName String
vpc Name. Should not be used with vpc_uuid.
vpcUuid String
Reference to a VPC UUID. Should not be used with vpc_name.

Outputs

All input properties are implicitly available as output properties. Additionally, the StaticRoutes resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Metadata Dictionary<string, string>
The vpc_route_table kind metadata.
Id string
The provider-assigned unique ID for this managed resource.
Metadata map[string]string
The vpc_route_table kind metadata.
id String
The provider-assigned unique ID for this managed resource.
metadata Map<String,String>
The vpc_route_table kind metadata.
id string
The provider-assigned unique ID for this managed resource.
metadata {[key: string]: string}
The vpc_route_table kind metadata.
id str
The provider-assigned unique ID for this managed resource.
metadata Mapping[str, str]
The vpc_route_table kind metadata.
id String
The provider-assigned unique ID for this managed resource.
metadata Map<String>
The vpc_route_table kind metadata.

Look up Existing StaticRoutes Resource

Get an existing StaticRoutes 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?: StaticRoutesState, opts?: CustomResourceOptions): StaticRoutes
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_version: Optional[str] = None,
        default_route_nexthops: Optional[Sequence[StaticRoutesDefaultRouteNexthopArgs]] = None,
        metadata: Optional[Mapping[str, str]] = None,
        static_routes_lists: Optional[Sequence[StaticRoutesStaticRoutesListArgs]] = None,
        vpc_name: Optional[str] = None,
        vpc_uuid: Optional[str] = None) -> StaticRoutes
func GetStaticRoutes(ctx *Context, name string, id IDInput, state *StaticRoutesState, opts ...ResourceOption) (*StaticRoutes, error)
public static StaticRoutes Get(string name, Input<string> id, StaticRoutesState? state, CustomResourceOptions? opts = null)
public static StaticRoutes get(String name, Output<String> id, StaticRoutesState state, CustomResourceOptions options)
resources:  _:    type: nutanix:StaticRoutes    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ApiVersion string
The version of the API.
DefaultRouteNexthops List<PiersKarsenbarg.Nutanix.Inputs.StaticRoutesDefaultRouteNexthop>
Default Route
Metadata Dictionary<string, string>
The vpc_route_table kind metadata.
StaticRoutesLists List<PiersKarsenbarg.Nutanix.Inputs.StaticRoutesStaticRoutesList>
Static Routes.
VpcName string
vpc Name. Should not be used with vpc_uuid.
VpcUuid string
Reference to a VPC UUID. Should not be used with vpc_name.
ApiVersion string
The version of the API.
DefaultRouteNexthops []StaticRoutesDefaultRouteNexthopArgs
Default Route
Metadata map[string]string
The vpc_route_table kind metadata.
StaticRoutesLists []StaticRoutesStaticRoutesListArgs
Static Routes.
VpcName string
vpc Name. Should not be used with vpc_uuid.
VpcUuid string
Reference to a VPC UUID. Should not be used with vpc_name.
apiVersion String
The version of the API.
defaultRouteNexthops List<StaticRoutesDefaultRouteNexthop>
Default Route
metadata Map<String,String>
The vpc_route_table kind metadata.
staticRoutesLists List<StaticRoutesStaticRoutesList>
Static Routes.
vpcName String
vpc Name. Should not be used with vpc_uuid.
vpcUuid String
Reference to a VPC UUID. Should not be used with vpc_name.
apiVersion string
The version of the API.
defaultRouteNexthops StaticRoutesDefaultRouteNexthop[]
Default Route
metadata {[key: string]: string}
The vpc_route_table kind metadata.
staticRoutesLists StaticRoutesStaticRoutesList[]
Static Routes.
vpcName string
vpc Name. Should not be used with vpc_uuid.
vpcUuid string
Reference to a VPC UUID. Should not be used with vpc_name.
api_version str
The version of the API.
default_route_nexthops Sequence[StaticRoutesDefaultRouteNexthopArgs]
Default Route
metadata Mapping[str, str]
The vpc_route_table kind metadata.
static_routes_lists Sequence[StaticRoutesStaticRoutesListArgs]
Static Routes.
vpc_name str
vpc Name. Should not be used with vpc_uuid.
vpc_uuid str
Reference to a VPC UUID. Should not be used with vpc_name.
apiVersion String
The version of the API.
defaultRouteNexthops List<Property Map>
Default Route
metadata Map<String>
The vpc_route_table kind metadata.
staticRoutesLists List<Property Map>
Static Routes.
vpcName String
vpc Name. Should not be used with vpc_uuid.
vpcUuid String
Reference to a VPC UUID. Should not be used with vpc_name.

Supporting Types

StaticRoutesDefaultRouteNexthop
, StaticRoutesDefaultRouteNexthopArgs

ExternalSubnetReferenceUuid string
Reference to a subnet.
ExternalSubnetReferenceUuid string
Reference to a subnet.
externalSubnetReferenceUuid String
Reference to a subnet.
externalSubnetReferenceUuid string
Reference to a subnet.
external_subnet_reference_uuid str
Reference to a subnet.
externalSubnetReferenceUuid String
Reference to a subnet.

StaticRoutesStaticRoutesList
, StaticRoutesStaticRoutesListArgs

Destination This property is required. string
Destination ip with prefix.
ExternalSubnetReferenceUuid string
Reference to a subnet. Supported with 2022.x .
VpnConnectionReferenceUuid string
Reference to a vpn connection.
Destination This property is required. string
Destination ip with prefix.
ExternalSubnetReferenceUuid string
Reference to a subnet. Supported with 2022.x .
VpnConnectionReferenceUuid string
Reference to a vpn connection.
destination This property is required. String
Destination ip with prefix.
externalSubnetReferenceUuid String
Reference to a subnet. Supported with 2022.x .
vpnConnectionReferenceUuid String
Reference to a vpn connection.
destination This property is required. string
Destination ip with prefix.
externalSubnetReferenceUuid string
Reference to a subnet. Supported with 2022.x .
vpnConnectionReferenceUuid string
Reference to a vpn connection.
destination This property is required. str
Destination ip with prefix.
external_subnet_reference_uuid str
Reference to a subnet. Supported with 2022.x .
vpn_connection_reference_uuid str
Reference to a vpn connection.
destination This property is required. String
Destination ip with prefix.
externalSubnetReferenceUuid String
Reference to a subnet. Supported with 2022.x .
vpnConnectionReferenceUuid String
Reference to a vpn connection.

Package Details

Repository
nutanix pierskarsenbarg/pulumi-nutanix
License
Apache-2.0
Notes
This Pulumi package is based on the nutanix Terraform Provider.