azure logo
Azure Classic v5.43.0, May 6 23

azure.network.VirtualHubConnection

Explore with Pulumi AI

Manages a Connection for a Virtual Hub.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
    {
        AddressSpaces = new[]
        {
            "172.0.0.0/16",
        },
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
    });

    var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
    });

    var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        VirtualWanId = exampleVirtualWan.Id,
        AddressPrefix = "10.0.1.0/24",
    });

    var exampleVirtualHubConnection = new Azure.Network.VirtualHubConnection("exampleVirtualHubConnection", new()
    {
        VirtualHubId = exampleVirtualHub.Id,
        RemoteVirtualNetworkId = exampleVirtualNetwork.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
			AddressSpaces: pulumi.StringArray{
				pulumi.String("172.0.0.0/16"),
			},
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
		})
		if err != nil {
			return err
		}
		exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
		})
		if err != nil {
			return err
		}
		exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
			VirtualWanId:      exampleVirtualWan.ID(),
			AddressPrefix:     pulumi.String("10.0.1.0/24"),
		})
		if err != nil {
			return err
		}
		_, err = network.NewVirtualHubConnection(ctx, "exampleVirtualHubConnection", &network.VirtualHubConnectionArgs{
			VirtualHubId:           exampleVirtualHub.ID(),
			RemoteVirtualNetworkId: exampleVirtualNetwork.ID(),
		})
		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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.VirtualWan;
import com.pulumi.azure.network.VirtualWanArgs;
import com.pulumi.azure.network.VirtualHub;
import com.pulumi.azure.network.VirtualHubArgs;
import com.pulumi.azure.network.VirtualHubConnection;
import com.pulumi.azure.network.VirtualHubConnectionArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
            .addressSpaces("172.0.0.0/16")
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .build());

        var exampleVirtualWan = new VirtualWan("exampleVirtualWan", VirtualWanArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .build());

        var exampleVirtualHub = new VirtualHub("exampleVirtualHub", VirtualHubArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .virtualWanId(exampleVirtualWan.id())
            .addressPrefix("10.0.1.0/24")
            .build());

        var exampleVirtualHubConnection = new VirtualHubConnection("exampleVirtualHubConnection", VirtualHubConnectionArgs.builder()        
            .virtualHubId(exampleVirtualHub.id())
            .remoteVirtualNetworkId(exampleVirtualNetwork.id())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["172.0.0.0/16"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location)
example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    virtual_wan_id=example_virtual_wan.id,
    address_prefix="10.0.1.0/24")
example_virtual_hub_connection = azure.network.VirtualHubConnection("exampleVirtualHubConnection",
    virtual_hub_id=example_virtual_hub.id,
    remote_virtual_network_id=example_virtual_network.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    addressSpaces: ["172.0.0.0/16"],
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
});
const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
});
const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    virtualWanId: exampleVirtualWan.id,
    addressPrefix: "10.0.1.0/24",
});
const exampleVirtualHubConnection = new azure.network.VirtualHubConnection("exampleVirtualHubConnection", {
    virtualHubId: exampleVirtualHub.id,
    remoteVirtualNetworkId: exampleVirtualNetwork.id,
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      addressSpaces:
        - 172.0.0.0/16
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
  exampleVirtualWan:
    type: azure:network:VirtualWan
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
  exampleVirtualHub:
    type: azure:network:VirtualHub
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      virtualWanId: ${exampleVirtualWan.id}
      addressPrefix: 10.0.1.0/24
  exampleVirtualHubConnection:
    type: azure:network:VirtualHubConnection
    properties:
      virtualHubId: ${exampleVirtualHub.id}
      remoteVirtualNetworkId: ${exampleVirtualNetwork.id}

Create VirtualHubConnection Resource

new VirtualHubConnection(name: string, args: VirtualHubConnectionArgs, opts?: CustomResourceOptions);
@overload
def VirtualHubConnection(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         internet_security_enabled: Optional[bool] = None,
                         name: Optional[str] = None,
                         remote_virtual_network_id: Optional[str] = None,
                         routing: Optional[VirtualHubConnectionRoutingArgs] = None,
                         virtual_hub_id: Optional[str] = None)
@overload
def VirtualHubConnection(resource_name: str,
                         args: VirtualHubConnectionArgs,
                         opts: Optional[ResourceOptions] = None)
func NewVirtualHubConnection(ctx *Context, name string, args VirtualHubConnectionArgs, opts ...ResourceOption) (*VirtualHubConnection, error)
public VirtualHubConnection(string name, VirtualHubConnectionArgs args, CustomResourceOptions? opts = null)
public VirtualHubConnection(String name, VirtualHubConnectionArgs args)
public VirtualHubConnection(String name, VirtualHubConnectionArgs args, CustomResourceOptions options)
type: azure:network:VirtualHubConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args VirtualHubConnectionArgs
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 VirtualHubConnectionArgs
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 VirtualHubConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VirtualHubConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args VirtualHubConnectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

RemoteVirtualNetworkId string

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

VirtualHubId string

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

InternetSecurityEnabled bool

Should Internet Security be enabled to secure internet traffic? Defaults to false.

Name string

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

Routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

RemoteVirtualNetworkId string

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

VirtualHubId string

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

InternetSecurityEnabled bool

Should Internet Security be enabled to secure internet traffic? Defaults to false.

Name string

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

Routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

remoteVirtualNetworkId String

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

virtualHubId String

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

internetSecurityEnabled Boolean

Should Internet Security be enabled to secure internet traffic? Defaults to false.

name String

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

remoteVirtualNetworkId string

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

virtualHubId string

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

internetSecurityEnabled boolean

Should Internet Security be enabled to secure internet traffic? Defaults to false.

name string

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

remote_virtual_network_id str

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

virtual_hub_id str

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

internet_security_enabled bool

Should Internet Security be enabled to secure internet traffic? Defaults to false.

name str

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

remoteVirtualNetworkId String

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

virtualHubId String

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

internetSecurityEnabled Boolean

Should Internet Security be enabled to secure internet traffic? Defaults to false.

name String

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

routing Property Map

A routing block as defined below.

Outputs

All input properties are implicitly available as output properties. Additionally, the VirtualHubConnection 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 VirtualHubConnection Resource

Get an existing VirtualHubConnection 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?: VirtualHubConnectionState, opts?: CustomResourceOptions): VirtualHubConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        internet_security_enabled: Optional[bool] = None,
        name: Optional[str] = None,
        remote_virtual_network_id: Optional[str] = None,
        routing: Optional[VirtualHubConnectionRoutingArgs] = None,
        virtual_hub_id: Optional[str] = None) -> VirtualHubConnection
func GetVirtualHubConnection(ctx *Context, name string, id IDInput, state *VirtualHubConnectionState, opts ...ResourceOption) (*VirtualHubConnection, error)
public static VirtualHubConnection Get(string name, Input<string> id, VirtualHubConnectionState? state, CustomResourceOptions? opts = null)
public static VirtualHubConnection get(String name, Output<String> id, VirtualHubConnectionState 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.
The following state arguments are supported:
InternetSecurityEnabled bool

Should Internet Security be enabled to secure internet traffic? Defaults to false.

Name string

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

RemoteVirtualNetworkId string

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

Routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

VirtualHubId string

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

InternetSecurityEnabled bool

Should Internet Security be enabled to secure internet traffic? Defaults to false.

Name string

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

RemoteVirtualNetworkId string

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

Routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

VirtualHubId string

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

internetSecurityEnabled Boolean

Should Internet Security be enabled to secure internet traffic? Defaults to false.

name String

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

remoteVirtualNetworkId String

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

virtualHubId String

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

internetSecurityEnabled boolean

Should Internet Security be enabled to secure internet traffic? Defaults to false.

name string

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

remoteVirtualNetworkId string

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

virtualHubId string

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

internet_security_enabled bool

Should Internet Security be enabled to secure internet traffic? Defaults to false.

name str

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

remote_virtual_network_id str

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

routing VirtualHubConnectionRoutingArgs

A routing block as defined below.

virtual_hub_id str

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

internetSecurityEnabled Boolean

Should Internet Security be enabled to secure internet traffic? Defaults to false.

name String

The Name which should be used for this Connection, which must be unique within the Virtual Hub. Changing this forces a new resource to be created.

remoteVirtualNetworkId String

The ID of the Virtual Network which the Virtual Hub should be connected to. Changing this forces a new resource to be created.

routing Property Map

A routing block as defined below.

virtualHubId String

The ID of the Virtual Hub within which this connection should be created. Changing this forces a new resource to be created.

Supporting Types

VirtualHubConnectionRouting

AssociatedRouteTableId string

The ID of the route table associated with this Virtual Hub connection.

PropagatedRouteTable VirtualHubConnectionRoutingPropagatedRouteTable

A propagated_route_table block as defined below.

StaticVnetRoutes List<VirtualHubConnectionRoutingStaticVnetRoute>

A static_vnet_route block as defined below.

AssociatedRouteTableId string

The ID of the route table associated with this Virtual Hub connection.

PropagatedRouteTable VirtualHubConnectionRoutingPropagatedRouteTable

A propagated_route_table block as defined below.

StaticVnetRoutes []VirtualHubConnectionRoutingStaticVnetRoute

A static_vnet_route block as defined below.

associatedRouteTableId String

The ID of the route table associated with this Virtual Hub connection.

propagatedRouteTable VirtualHubConnectionRoutingPropagatedRouteTable

A propagated_route_table block as defined below.

staticVnetRoutes List<VirtualHubConnectionRoutingStaticVnetRoute>

A static_vnet_route block as defined below.

associatedRouteTableId string

The ID of the route table associated with this Virtual Hub connection.

propagatedRouteTable VirtualHubConnectionRoutingPropagatedRouteTable

A propagated_route_table block as defined below.

staticVnetRoutes VirtualHubConnectionRoutingStaticVnetRoute[]

A static_vnet_route block as defined below.

associated_route_table_id str

The ID of the route table associated with this Virtual Hub connection.

propagated_route_table VirtualHubConnectionRoutingPropagatedRouteTable

A propagated_route_table block as defined below.

static_vnet_routes Sequence[VirtualHubConnectionRoutingStaticVnetRoute]

A static_vnet_route block as defined below.

associatedRouteTableId String

The ID of the route table associated with this Virtual Hub connection.

propagatedRouteTable Property Map

A propagated_route_table block as defined below.

staticVnetRoutes List<Property Map>

A static_vnet_route block as defined below.

VirtualHubConnectionRoutingPropagatedRouteTable

Labels List<string>

The list of labels to assign to this route table.

RouteTableIds List<string>

A list of Route Table IDs to associated with this Virtual Hub Connection.

Labels []string

The list of labels to assign to this route table.

RouteTableIds []string

A list of Route Table IDs to associated with this Virtual Hub Connection.

labels List<String>

The list of labels to assign to this route table.

routeTableIds List<String>

A list of Route Table IDs to associated with this Virtual Hub Connection.

labels string[]

The list of labels to assign to this route table.

routeTableIds string[]

A list of Route Table IDs to associated with this Virtual Hub Connection.

labels Sequence[str]

The list of labels to assign to this route table.

route_table_ids Sequence[str]

A list of Route Table IDs to associated with this Virtual Hub Connection.

labels List<String>

The list of labels to assign to this route table.

routeTableIds List<String>

A list of Route Table IDs to associated with this Virtual Hub Connection.

VirtualHubConnectionRoutingStaticVnetRoute

AddressPrefixes List<string>

A list of CIDR Ranges which should be used as Address Prefixes.

Name string

The name which should be used for this Static Route.

NextHopIpAddress string

The IP Address which should be used for the Next Hop.

AddressPrefixes []string

A list of CIDR Ranges which should be used as Address Prefixes.

Name string

The name which should be used for this Static Route.

NextHopIpAddress string

The IP Address which should be used for the Next Hop.

addressPrefixes List<String>

A list of CIDR Ranges which should be used as Address Prefixes.

name String

The name which should be used for this Static Route.

nextHopIpAddress String

The IP Address which should be used for the Next Hop.

addressPrefixes string[]

A list of CIDR Ranges which should be used as Address Prefixes.

name string

The name which should be used for this Static Route.

nextHopIpAddress string

The IP Address which should be used for the Next Hop.

address_prefixes Sequence[str]

A list of CIDR Ranges which should be used as Address Prefixes.

name str

The name which should be used for this Static Route.

next_hop_ip_address str

The IP Address which should be used for the Next Hop.

addressPrefixes List<String>

A list of CIDR Ranges which should be used as Address Prefixes.

name String

The name which should be used for this Static Route.

nextHopIpAddress String

The IP Address which should be used for the Next Hop.

Import

Virtual Hub Connection’s can be imported using the resource id, e.g.

 $ pulumi import azure:network/virtualHubConnection:VirtualHubConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/connection1

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.