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}}",
});
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}}")
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
})
}
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}}",
});
});
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());
}
}
resources:
scn:
type: nutanix:StaticRoutes
properties:
staticRoutesLists:
- destination: 10.x.x.x/x
externalSubnetReferenceUuid: '{{ext_subnet_uuid}}'
vpcUuid: '{{vpc_uuid}}'
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}}",
});
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}}")
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
})
}
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}}",
});
});
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());
}
}
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}}'
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 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 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 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 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 String
- The unique name of the resource.
- args 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",
});
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"),
})
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());
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")
const staticRoutesResource = new nutanix.StaticRoutes("staticRoutesResource", {
apiVersion: "string",
defaultRouteNexthops: [{
externalSubnetReferenceUuid: "string",
}],
staticRoutesLists: [{
destination: "string",
externalSubnetReferenceUuid: "string",
vpnConnectionReferenceUuid: "string",
}],
vpcName: "string",
vpcUuid: "string",
});
type: nutanix:StaticRoutes
properties:
apiVersion: string
defaultRouteNexthops:
- externalSubnetReferenceUuid: string
staticRoutesLists:
- destination: string
externalSubnetReferenceUuid: string
vpnConnectionReferenceUuid: string
vpcName: string
vpcUuid: string
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:
- Api
Version string - The version of the API.
- Default
Route List<PiersNexthops Karsenbarg. Nutanix. Inputs. Static Routes Default Route Nexthop> - Default Route
- Static
Routes List<PiersLists Karsenbarg. Nutanix. Inputs. Static Routes Static Routes List> - Static Routes.
- Vpc
Name string - vpc Name. Should not be used with vpc_uuid.
- Vpc
Uuid string - Reference to a VPC UUID. Should not be used with vpc_name.
- Api
Version string - The version of the API.
- Default
Route []StaticNexthops Routes Default Route Nexthop Args - Default Route
- Static
Routes []StaticLists Routes Static Routes List Args - Static Routes.
- Vpc
Name string - vpc Name. Should not be used with vpc_uuid.
- Vpc
Uuid string - Reference to a VPC UUID. Should not be used with vpc_name.
- api
Version String - The version of the API.
- default
Route List<StaticNexthops Routes Default Route Nexthop> - Default Route
- static
Routes List<StaticLists Routes Static Routes List> - Static Routes.
- vpc
Name String - vpc Name. Should not be used with vpc_uuid.
- vpc
Uuid String - Reference to a VPC UUID. Should not be used with vpc_name.
- api
Version string - The version of the API.
- default
Route StaticNexthops Routes Default Route Nexthop[] - Default Route
- static
Routes StaticLists Routes Static Routes List[] - Static Routes.
- vpc
Name string - vpc Name. Should not be used with vpc_uuid.
- vpc
Uuid string - Reference to a VPC UUID. Should not be used with vpc_name.
- api_
version str - The version of the API.
- default_
route_ Sequence[Staticnexthops Routes Default Route Nexthop Args] - Default Route
- static_
routes_ Sequence[Staticlists Routes Static Routes List Args] - 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.
- api
Version String - The version of the API.
- default
Route List<Property Map>Nexthops - Default Route
- static
Routes List<Property Map>Lists - Static Routes.
- vpc
Name String - vpc Name. Should not be used with vpc_uuid.
- vpc
Uuid 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:
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)
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.
- Api
Version string - The version of the API.
- Default
Route List<PiersNexthops Karsenbarg. Nutanix. Inputs. Static Routes Default Route Nexthop> - Default Route
- Metadata Dictionary<string, string>
- The vpc_route_table kind metadata.
- Static
Routes List<PiersLists Karsenbarg. Nutanix. Inputs. Static Routes Static Routes List> - Static Routes.
- Vpc
Name string - vpc Name. Should not be used with vpc_uuid.
- Vpc
Uuid string - Reference to a VPC UUID. Should not be used with vpc_name.
- Api
Version string - The version of the API.
- Default
Route []StaticNexthops Routes Default Route Nexthop Args - Default Route
- Metadata map[string]string
- The vpc_route_table kind metadata.
- Static
Routes []StaticLists Routes Static Routes List Args - Static Routes.
- Vpc
Name string - vpc Name. Should not be used with vpc_uuid.
- Vpc
Uuid string - Reference to a VPC UUID. Should not be used with vpc_name.
- api
Version String - The version of the API.
- default
Route List<StaticNexthops Routes Default Route Nexthop> - Default Route
- metadata Map<String,String>
- The vpc_route_table kind metadata.
- static
Routes List<StaticLists Routes Static Routes List> - Static Routes.
- vpc
Name String - vpc Name. Should not be used with vpc_uuid.
- vpc
Uuid String - Reference to a VPC UUID. Should not be used with vpc_name.
- api
Version string - The version of the API.
- default
Route StaticNexthops Routes Default Route Nexthop[] - Default Route
- metadata {[key: string]: string}
- The vpc_route_table kind metadata.
- static
Routes StaticLists Routes Static Routes List[] - Static Routes.
- vpc
Name string - vpc Name. Should not be used with vpc_uuid.
- vpc
Uuid string - Reference to a VPC UUID. Should not be used with vpc_name.
- api_
version str - The version of the API.
- default_
route_ Sequence[Staticnexthops Routes Default Route Nexthop Args] - Default Route
- metadata Mapping[str, str]
- The vpc_route_table kind metadata.
- static_
routes_ Sequence[Staticlists Routes Static Routes List Args] - 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.
- api
Version String - The version of the API.
- default
Route List<Property Map>Nexthops - Default Route
- metadata Map<String>
- The vpc_route_table kind metadata.
- static
Routes List<Property Map>Lists - Static Routes.
- vpc
Name String - vpc Name. Should not be used with vpc_uuid.
- vpc
Uuid String - Reference to a VPC UUID. Should not be used with vpc_name.
Supporting Types
StaticRoutesDefaultRouteNexthop, StaticRoutesDefaultRouteNexthopArgs
- External
Subnet stringReference Uuid - Reference to a subnet.
- External
Subnet stringReference Uuid - Reference to a subnet.
- external
Subnet StringReference Uuid - Reference to a subnet.
- external
Subnet stringReference Uuid - Reference to a subnet.
- external_
subnet_ strreference_ uuid - Reference to a subnet.
- external
Subnet StringReference Uuid - Reference to a subnet.
StaticRoutesStaticRoutesList, StaticRoutesStaticRoutesListArgs
- Destination string
- Destination ip with prefix.
- External
Subnet stringReference Uuid - Reference to a subnet. Supported with 2022.x .
- Vpn
Connection stringReference Uuid - Reference to a vpn connection.
- Destination string
- Destination ip with prefix.
- External
Subnet stringReference Uuid - Reference to a subnet. Supported with 2022.x .
- Vpn
Connection stringReference Uuid - Reference to a vpn connection.
- destination String
- Destination ip with prefix.
- external
Subnet StringReference Uuid - Reference to a subnet. Supported with 2022.x .
- vpn
Connection StringReference Uuid - Reference to a vpn connection.
- destination string
- Destination ip with prefix.
- external
Subnet stringReference Uuid - Reference to a subnet. Supported with 2022.x .
- vpn
Connection stringReference Uuid - Reference to a vpn connection.
- destination str
- Destination ip with prefix.
- external_
subnet_ strreference_ uuid - Reference to a subnet. Supported with 2022.x .
- vpn_
connection_ strreference_ uuid - Reference to a vpn connection.
- destination String
- Destination ip with prefix.
- external
Subnet StringReference Uuid - Reference to a subnet. Supported with 2022.x .
- vpn
Connection StringReference Uuid - 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.