azure-native.network.VirtualRouter
Explore with Pulumi AI
VirtualRouter Resource. API Version: 2022-01-01.
Example Usage
Create VirtualRouter
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var virtualRouter = new AzureNative.Network.VirtualRouter("virtualRouter", new()
{
HostedGateway = new AzureNative.Network.Inputs.SubResourceArgs
{
Id = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway",
},
Location = "West US",
ResourceGroupName = "rg1",
Tags =
{
{ "key1", "value1" },
},
VirtualRouterName = "virtualRouter",
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewVirtualRouter(ctx, "virtualRouter", &network.VirtualRouterArgs{
HostedGateway: &network.SubResourceArgs{
Id: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"),
},
Location: pulumi.String("West US"),
ResourceGroupName: pulumi.String("rg1"),
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
},
VirtualRouterName: pulumi.String("virtualRouter"),
})
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.azurenative.network.VirtualRouter;
import com.pulumi.azurenative.network.VirtualRouterArgs;
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 virtualRouter = new VirtualRouter("virtualRouter", VirtualRouterArgs.builder()
.hostedGateway(Map.of("id", "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"))
.location("West US")
.resourceGroupName("rg1")
.tags(Map.of("key1", "value1"))
.virtualRouterName("virtualRouter")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
virtual_router = azure_native.network.VirtualRouter("virtualRouter",
hosted_gateway=azure_native.network.SubResourceArgs(
id="/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway",
),
location="West US",
resource_group_name="rg1",
tags={
"key1": "value1",
},
virtual_router_name="virtualRouter")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const virtualRouter = new azure_native.network.VirtualRouter("virtualRouter", {
hostedGateway: {
id: "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway",
},
location: "West US",
resourceGroupName: "rg1",
tags: {
key1: "value1",
},
virtualRouterName: "virtualRouter",
});
resources:
virtualRouter:
type: azure-native:network:VirtualRouter
properties:
hostedGateway:
id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway
location: West US
resourceGroupName: rg1
tags:
key1: value1
virtualRouterName: virtualRouter
Create VirtualRouter Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualRouter(name: string, args: VirtualRouterArgs, opts?: CustomResourceOptions);
@overload
def VirtualRouter(resource_name: str,
args: VirtualRouterArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualRouter(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
hosted_gateway: Optional[SubResourceArgs] = None,
hosted_subnet: Optional[SubResourceArgs] = None,
id: Optional[str] = None,
location: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
virtual_router_asn: Optional[float] = None,
virtual_router_ips: Optional[Sequence[str]] = None,
virtual_router_name: Optional[str] = None)
func NewVirtualRouter(ctx *Context, name string, args VirtualRouterArgs, opts ...ResourceOption) (*VirtualRouter, error)
public VirtualRouter(string name, VirtualRouterArgs args, CustomResourceOptions? opts = null)
public VirtualRouter(String name, VirtualRouterArgs args)
public VirtualRouter(String name, VirtualRouterArgs args, CustomResourceOptions options)
type: azure-native:network:VirtualRouter
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 VirtualRouterArgs
- 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 VirtualRouterArgs
- 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 VirtualRouterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VirtualRouterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VirtualRouterArgs
- 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 virtualRouterResource = new AzureNative.Network.VirtualRouter("virtualRouterResource", new()
{
ResourceGroupName = "string",
HostedGateway =
{
{ "id", "string" },
},
HostedSubnet =
{
{ "id", "string" },
},
Id = "string",
Location = "string",
Tags =
{
{ "string", "string" },
},
VirtualRouterAsn = 0,
VirtualRouterIps = new[]
{
"string",
},
VirtualRouterName = "string",
});
example, err := network.NewVirtualRouter(ctx, "virtualRouterResource", &network.VirtualRouterArgs{
ResourceGroupName: "string",
HostedGateway: map[string]interface{}{
"id": "string",
},
HostedSubnet: map[string]interface{}{
"id": "string",
},
Id: "string",
Location: "string",
Tags: map[string]interface{}{
"string": "string",
},
VirtualRouterAsn: 0,
VirtualRouterIps: []string{
"string",
},
VirtualRouterName: "string",
})
var virtualRouterResource = new VirtualRouter("virtualRouterResource", VirtualRouterArgs.builder()
.resourceGroupName("string")
.hostedGateway(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.hostedSubnet(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.id("string")
.location("string")
.tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.virtualRouterAsn(0)
.virtualRouterIps("string")
.virtualRouterName("string")
.build());
virtual_router_resource = azure_native.network.VirtualRouter("virtualRouterResource",
resource_group_name=string,
hosted_gateway={
id: string,
},
hosted_subnet={
id: string,
},
id=string,
location=string,
tags={
string: string,
},
virtual_router_asn=0,
virtual_router_ips=[string],
virtual_router_name=string)
const virtualRouterResource = new azure_native.network.VirtualRouter("virtualRouterResource", {
resourceGroupName: "string",
hostedGateway: {
id: "string",
},
hostedSubnet: {
id: "string",
},
id: "string",
location: "string",
tags: {
string: "string",
},
virtualRouterAsn: 0,
virtualRouterIps: ["string"],
virtualRouterName: "string",
});
type: azure-native:network:VirtualRouter
properties:
hostedGateway:
id: string
hostedSubnet:
id: string
id: string
location: string
resourceGroupName: string
tags:
string: string
virtualRouterAsn: 0
virtualRouterIps:
- string
virtualRouterName: string
VirtualRouter 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 VirtualRouter resource accepts the following input properties:
- Resource
Group stringName - The name of the resource group.
- Hosted
Gateway Pulumi.Azure Native. Network. Inputs. Sub Resource - The Gateway on which VirtualRouter is hosted.
- Hosted
Subnet Pulumi.Azure Native. Network. Inputs. Sub Resource - The Subnet on which VirtualRouter is hosted.
- Id string
- Resource ID.
- Location string
- Resource location.
- Dictionary<string, string>
- Resource tags.
- Virtual
Router doubleAsn - VirtualRouter ASN.
- Virtual
Router List<string>Ips - VirtualRouter IPs.
- Virtual
Router stringName - The name of the Virtual Router.
- Resource
Group stringName - The name of the resource group.
- Hosted
Gateway SubResource Args - The Gateway on which VirtualRouter is hosted.
- Hosted
Subnet SubResource Args - The Subnet on which VirtualRouter is hosted.
- Id string
- Resource ID.
- Location string
- Resource location.
- map[string]string
- Resource tags.
- Virtual
Router float64Asn - VirtualRouter ASN.
- Virtual
Router []stringIps - VirtualRouter IPs.
- Virtual
Router stringName - The name of the Virtual Router.
- resource
Group StringName - The name of the resource group.
- hosted
Gateway SubResource - The Gateway on which VirtualRouter is hosted.
- hosted
Subnet SubResource - The Subnet on which VirtualRouter is hosted.
- id String
- Resource ID.
- location String
- Resource location.
- Map<String,String>
- Resource tags.
- virtual
Router DoubleAsn - VirtualRouter ASN.
- virtual
Router List<String>Ips - VirtualRouter IPs.
- virtual
Router StringName - The name of the Virtual Router.
- resource
Group stringName - The name of the resource group.
- hosted
Gateway SubResource - The Gateway on which VirtualRouter is hosted.
- hosted
Subnet SubResource - The Subnet on which VirtualRouter is hosted.
- id string
- Resource ID.
- location string
- Resource location.
- {[key: string]: string}
- Resource tags.
- virtual
Router numberAsn - VirtualRouter ASN.
- virtual
Router string[]Ips - VirtualRouter IPs.
- virtual
Router stringName - The name of the Virtual Router.
- resource_
group_ strname - The name of the resource group.
- hosted_
gateway SubResource Args - The Gateway on which VirtualRouter is hosted.
- hosted_
subnet SubResource Args - The Subnet on which VirtualRouter is hosted.
- id str
- Resource ID.
- location str
- Resource location.
- Mapping[str, str]
- Resource tags.
- virtual_
router_ floatasn - VirtualRouter ASN.
- virtual_
router_ Sequence[str]ips - VirtualRouter IPs.
- virtual_
router_ strname - The name of the Virtual Router.
- resource
Group StringName - The name of the resource group.
- hosted
Gateway Property Map - The Gateway on which VirtualRouter is hosted.
- hosted
Subnet Property Map - The Subnet on which VirtualRouter is hosted.
- id String
- Resource ID.
- location String
- Resource location.
- Map<String>
- Resource tags.
- virtual
Router NumberAsn - VirtualRouter ASN.
- virtual
Router List<String>Ips - VirtualRouter IPs.
- virtual
Router StringName - The name of the Virtual Router.
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualRouter resource produces the following output properties:
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource name.
- Peerings
List<Pulumi.
Azure Native. Network. Outputs. Sub Resource Response> - List of references to VirtualRouterPeerings.
- Provisioning
State string - The provisioning state of the resource.
- Type string
- Resource type.
- Etag string
- A unique read-only string that changes whenever the resource is updated.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Resource name.
- Peerings
[]Sub
Resource Response - List of references to VirtualRouterPeerings.
- Provisioning
State string - The provisioning state of the resource.
- Type string
- Resource type.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Resource name.
- peerings
List<Sub
Resource Response> - List of references to VirtualRouterPeerings.
- provisioning
State String - The provisioning state of the resource.
- type String
- Resource type.
- etag string
- A unique read-only string that changes whenever the resource is updated.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Resource name.
- peerings
Sub
Resource Response[] - List of references to VirtualRouterPeerings.
- provisioning
State string - The provisioning state of the resource.
- type string
- Resource type.
- etag str
- A unique read-only string that changes whenever the resource is updated.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Resource name.
- peerings
Sequence[Sub
Resource Response] - List of references to VirtualRouterPeerings.
- provisioning_
state str - The provisioning state of the resource.
- type str
- Resource type.
- etag String
- A unique read-only string that changes whenever the resource is updated.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Resource name.
- peerings List<Property Map>
- List of references to VirtualRouterPeerings.
- provisioning
State String - The provisioning state of the resource.
- type String
- Resource type.
Supporting Types
SubResource, SubResourceArgs
- Id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- Id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id String
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id string
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id str
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
- id String
- Sub-resource ID. Both absolute resource ID and a relative resource ID are accepted. An absolute ID starts with /subscriptions/ and contains the entire ID of the parent resource and the ID of the sub-resource in the end. A relative ID replaces the ID of the parent resource with a token '$self', followed by the sub-resource ID itself. Example of a relative ID: $self/frontEndConfigurations/my-frontend.
SubResourceResponse, SubResourceResponseArgs
- Id string
- Resource ID.
- Id string
- Resource ID.
- id String
- Resource ID.
- id string
- Resource ID.
- id str
- Resource ID.
- id String
- Resource ID.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:VirtualRouter virtualRouter /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0