netbox.RouteTarget
Explore with Pulumi AI
From the official documentation:
A route target is a particular type of extended BGP community used to control the redistribution of routes among VRF tables in a network. Route targets can be assigned to individual VRFs in NetBox as import or export targets (or both) to model this exchange in an L3VPN. Each route target must be given a unique name, which should be in a format prescribed by RFC 4364, similar to a VR route distinguisher.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const testTenant = new netbox.Tenant("testTenant", {});
const testRouteTarget = new netbox.RouteTarget("testRouteTarget", {
description: "my description",
tenantId: testTenant.tenantId,
});
import pulumi
import pulumi_netbox as netbox
test_tenant = netbox.Tenant("testTenant")
test_route_target = netbox.RouteTarget("testRouteTarget",
description="my description",
tenant_id=test_tenant.tenant_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
testTenant, err := netbox.NewTenant(ctx, "testTenant", nil)
if err != nil {
return err
}
_, err = netbox.NewRouteTarget(ctx, "testRouteTarget", &netbox.RouteTargetArgs{
Description: pulumi.String("my description"),
TenantId: testTenant.TenantId,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;
return await Deployment.RunAsync(() =>
{
var testTenant = new Netbox.Tenant("testTenant");
var testRouteTarget = new Netbox.RouteTarget("testRouteTarget", new()
{
Description = "my description",
TenantId = testTenant.TenantId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Tenant;
import com.pulumi.netbox.RouteTarget;
import com.pulumi.netbox.RouteTargetArgs;
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 testTenant = new Tenant("testTenant");
var testRouteTarget = new RouteTarget("testRouteTarget", RouteTargetArgs.builder()
.description("my description")
.tenantId(testTenant.tenantId())
.build());
}
}
resources:
testTenant:
type: netbox:Tenant
testRouteTarget:
type: netbox:RouteTarget
properties:
description: my description
tenantId: ${testTenant.tenantId}
Create RouteTarget Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RouteTarget(name: string, args?: RouteTargetArgs, opts?: CustomResourceOptions);
@overload
def RouteTarget(resource_name: str,
args: Optional[RouteTargetArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def RouteTarget(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
name: Optional[str] = None,
route_target_id: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[float] = None)
func NewRouteTarget(ctx *Context, name string, args *RouteTargetArgs, opts ...ResourceOption) (*RouteTarget, error)
public RouteTarget(string name, RouteTargetArgs? args = null, CustomResourceOptions? opts = null)
public RouteTarget(String name, RouteTargetArgs args)
public RouteTarget(String name, RouteTargetArgs args, CustomResourceOptions options)
type: netbox:RouteTarget
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 RouteTargetArgs
- 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 RouteTargetArgs
- 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 RouteTargetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteTargetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RouteTargetArgs
- 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 routeTargetResource = new Netbox.RouteTarget("routeTargetResource", new()
{
Description = "string",
Name = "string",
RouteTargetId = "string",
Tags = new[]
{
"string",
},
TenantId = 0,
});
example, err := netbox.NewRouteTarget(ctx, "routeTargetResource", &netbox.RouteTargetArgs{
Description: pulumi.String("string"),
Name: pulumi.String("string"),
RouteTargetId: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
TenantId: pulumi.Float64(0),
})
var routeTargetResource = new RouteTarget("routeTargetResource", RouteTargetArgs.builder()
.description("string")
.name("string")
.routeTargetId("string")
.tags("string")
.tenantId(0)
.build());
route_target_resource = netbox.RouteTarget("routeTargetResource",
description="string",
name="string",
route_target_id="string",
tags=["string"],
tenant_id=0)
const routeTargetResource = new netbox.RouteTarget("routeTargetResource", {
description: "string",
name: "string",
routeTargetId: "string",
tags: ["string"],
tenantId: 0,
});
type: netbox:RouteTarget
properties:
description: string
name: string
routeTargetId: string
tags:
- string
tenantId: 0
RouteTarget 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 RouteTarget resource accepts the following input properties:
- Description string
- Name string
- Route
Target stringId - The ID of this resource.
- List<string>
- Tenant
Id double
- Description string
- Name string
- Route
Target stringId - The ID of this resource.
- []string
- Tenant
Id float64
- description String
- name String
- route
Target StringId - The ID of this resource.
- List<String>
- tenant
Id Double
- description string
- name string
- route
Target stringId - The ID of this resource.
- string[]
- tenant
Id number
- description str
- name str
- route_
target_ strid - The ID of this resource.
- Sequence[str]
- tenant_
id float
- description String
- name String
- route
Target StringId - The ID of this resource.
- List<String>
- tenant
Id Number
Outputs
All input properties are implicitly available as output properties. Additionally, the RouteTarget 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 RouteTarget Resource
Get an existing RouteTarget 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?: RouteTargetState, opts?: CustomResourceOptions): RouteTarget
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
name: Optional[str] = None,
route_target_id: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[float] = None) -> RouteTarget
func GetRouteTarget(ctx *Context, name string, id IDInput, state *RouteTargetState, opts ...ResourceOption) (*RouteTarget, error)
public static RouteTarget Get(string name, Input<string> id, RouteTargetState? state, CustomResourceOptions? opts = null)
public static RouteTarget get(String name, Output<String> id, RouteTargetState state, CustomResourceOptions options)
resources: _: type: netbox:RouteTarget 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.
- Description string
- Name string
- Route
Target stringId - The ID of this resource.
- List<string>
- Tenant
Id double
- Description string
- Name string
- Route
Target stringId - The ID of this resource.
- []string
- Tenant
Id float64
- description String
- name String
- route
Target StringId - The ID of this resource.
- List<String>
- tenant
Id Double
- description string
- name string
- route
Target stringId - The ID of this resource.
- string[]
- tenant
Id number
- description str
- name str
- route_
target_ strid - The ID of this resource.
- Sequence[str]
- tenant_
id float
- description String
- name String
- route
Target StringId - The ID of this resource.
- List<String>
- tenant
Id Number
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.