1. Packages
  2. Azure Native
  3. API Docs
  4. network
  5. VirtualRouter
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.63.0 published on Tuesday, Sep 24, 2024 by Pulumi

azure-native.network.VirtualRouter

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.63.0 published on Tuesday, Sep 24, 2024 by Pulumi

    VirtualRouter Resource. Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2022-01-01.

    Other available API versions: 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-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/v2"
    	"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 com.pulumi.azurenative.network.inputs.SubResourceArgs;
    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(SubResourceArgs.builder()
                    .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway")
                    .build())
                .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={
            "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 = new AzureNative.Network.Inputs.SubResourceArgs
        {
            Id = "string",
        },
        HostedSubnet = new AzureNative.Network.Inputs.SubResourceArgs
        {
            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: pulumi.String("string"),
    	HostedGateway: &network.SubResourceArgs{
    		Id: pulumi.String("string"),
    	},
    	HostedSubnet: &network.SubResourceArgs{
    		Id: pulumi.String("string"),
    	},
    	Id:       pulumi.String("string"),
    	Location: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	VirtualRouterAsn: pulumi.Float64(0),
    	VirtualRouterIps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	VirtualRouterName: pulumi.String("string"),
    })
    
    var virtualRouterResource = new VirtualRouter("virtualRouterResource", VirtualRouterArgs.builder()
        .resourceGroupName("string")
        .hostedGateway(SubResourceArgs.builder()
            .id("string")
            .build())
        .hostedSubnet(SubResourceArgs.builder()
            .id("string")
            .build())
        .id("string")
        .location("string")
        .tags(Map.of("string", "string"))
        .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

    The VirtualRouter resource accepts the following input properties:

    ResourceGroupName string
    The name of the resource group.
    HostedGateway Pulumi.AzureNative.Network.Inputs.SubResource
    The Gateway on which VirtualRouter is hosted.
    HostedSubnet Pulumi.AzureNative.Network.Inputs.SubResource
    The Subnet on which VirtualRouter is hosted.
    Id string
    Resource ID.
    Location string
    Resource location.
    Tags Dictionary<string, string>
    Resource tags.
    VirtualRouterAsn double
    VirtualRouter ASN.
    VirtualRouterIps List<string>
    VirtualRouter IPs.
    VirtualRouterName string
    The name of the Virtual Router.
    ResourceGroupName string
    The name of the resource group.
    HostedGateway SubResourceArgs
    The Gateway on which VirtualRouter is hosted.
    HostedSubnet SubResourceArgs
    The Subnet on which VirtualRouter is hosted.
    Id string
    Resource ID.
    Location string
    Resource location.
    Tags map[string]string
    Resource tags.
    VirtualRouterAsn float64
    VirtualRouter ASN.
    VirtualRouterIps []string
    VirtualRouter IPs.
    VirtualRouterName string
    The name of the Virtual Router.
    resourceGroupName String
    The name of the resource group.
    hostedGateway SubResource
    The Gateway on which VirtualRouter is hosted.
    hostedSubnet SubResource
    The Subnet on which VirtualRouter is hosted.
    id String
    Resource ID.
    location String
    Resource location.
    tags Map<String,String>
    Resource tags.
    virtualRouterAsn Double
    VirtualRouter ASN.
    virtualRouterIps List<String>
    VirtualRouter IPs.
    virtualRouterName String
    The name of the Virtual Router.
    resourceGroupName string
    The name of the resource group.
    hostedGateway SubResource
    The Gateway on which VirtualRouter is hosted.
    hostedSubnet SubResource
    The Subnet on which VirtualRouter is hosted.
    id string
    Resource ID.
    location string
    Resource location.
    tags {[key: string]: string}
    Resource tags.
    virtualRouterAsn number
    VirtualRouter ASN.
    virtualRouterIps string[]
    VirtualRouter IPs.
    virtualRouterName string
    The name of the Virtual Router.
    resource_group_name str
    The name of the resource group.
    hosted_gateway SubResourceArgs
    The Gateway on which VirtualRouter is hosted.
    hosted_subnet SubResourceArgs
    The Subnet on which VirtualRouter is hosted.
    id str
    Resource ID.
    location str
    Resource location.
    tags Mapping[str, str]
    Resource tags.
    virtual_router_asn float
    VirtualRouter ASN.
    virtual_router_ips Sequence[str]
    VirtualRouter IPs.
    virtual_router_name str
    The name of the Virtual Router.
    resourceGroupName String
    The name of the resource group.
    hostedGateway Property Map
    The Gateway on which VirtualRouter is hosted.
    hostedSubnet Property Map
    The Subnet on which VirtualRouter is hosted.
    id String
    Resource ID.
    location String
    Resource location.
    tags Map<String>
    Resource tags.
    virtualRouterAsn Number
    VirtualRouter ASN.
    virtualRouterIps List<String>
    VirtualRouter IPs.
    virtualRouterName String
    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.AzureNative.Network.Outputs.SubResourceResponse>
    List of references to VirtualRouterPeerings.
    ProvisioningState 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 []SubResourceResponse
    List of references to VirtualRouterPeerings.
    ProvisioningState 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<SubResourceResponse>
    List of references to VirtualRouterPeerings.
    provisioningState 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 SubResourceResponse[]
    List of references to VirtualRouterPeerings.
    provisioningState 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[SubResourceResponse]
    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.
    provisioningState 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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName} 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.63.0 published on Tuesday, Sep 24, 2024 by Pulumi