BgpConnection

Manages a Bgp Connection for a Virtual Hub.

Example Usage

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

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

    var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        Sku = "Standard",
    });

    var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        AllocationMethod = "Static",
        Sku = "Standard",
    });

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

    var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        VirtualNetworkName = exampleVirtualNetwork.Name,
        AddressPrefixes = new[]
        {
            "10.5.1.0/24",
        },
    });

    var exampleVirtualHubIp = new Azure.Network.VirtualHubIp("exampleVirtualHubIp", new()
    {
        VirtualHubId = exampleVirtualHub.Id,
        PrivateIpAddress = "10.5.1.18",
        PrivateIpAllocationMethod = "Static",
        PublicIpAddressId = examplePublicIp.Id,
        SubnetId = exampleSubnet.Id,
    });

    var exampleBgpConnection = new Azure.Network.BgpConnection("exampleBgpConnection", new()
    {
        VirtualHubId = exampleVirtualHub.Id,
        PeerAsn = 65514,
        PeerIp = "169.254.21.5",
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            exampleVirtualHubIp,
        },
    });

});
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
		}
		exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
			Sku:               pulumi.String("Standard"),
		})
		if err != nil {
			return err
		}
		examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			AllocationMethod:  pulumi.String("Static"),
			Sku:               pulumi.String("Standard"),
		})
		if err != nil {
			return err
		}
		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.5.0.0/16"),
			},
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
		})
		if err != nil {
			return err
		}
		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
			ResourceGroupName:  exampleResourceGroup.Name,
			VirtualNetworkName: exampleVirtualNetwork.Name,
			AddressPrefixes: pulumi.StringArray{
				pulumi.String("10.5.1.0/24"),
			},
		})
		if err != nil {
			return err
		}
		exampleVirtualHubIp, err := network.NewVirtualHubIp(ctx, "exampleVirtualHubIp", &network.VirtualHubIpArgs{
			VirtualHubId:              exampleVirtualHub.ID(),
			PrivateIpAddress:          pulumi.String("10.5.1.18"),
			PrivateIpAllocationMethod: pulumi.String("Static"),
			PublicIpAddressId:         examplePublicIp.ID(),
			SubnetId:                  exampleSubnet.ID(),
		})
		if err != nil {
			return err
		}
		_, err = network.NewBgpConnection(ctx, "exampleBgpConnection", &network.BgpConnectionArgs{
			VirtualHubId: exampleVirtualHub.ID(),
			PeerAsn:      pulumi.Int(65514),
			PeerIp:       pulumi.String("169.254.21.5"),
		}, pulumi.DependsOn([]pulumi.Resource{
			exampleVirtualHubIp,
		}))
		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.VirtualHub;
import com.pulumi.azure.network.VirtualHubArgs;
import com.pulumi.azure.network.PublicIp;
import com.pulumi.azure.network.PublicIpArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.VirtualHubIp;
import com.pulumi.azure.network.VirtualHubIpArgs;
import com.pulumi.azure.network.BgpConnection;
import com.pulumi.azure.network.BgpConnectionArgs;
import com.pulumi.resources.CustomResourceOptions;
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 exampleVirtualHub = new VirtualHub("exampleVirtualHub", VirtualHubArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .sku("Standard")
            .build());

        var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .allocationMethod("Static")
            .sku("Standard")
            .build());

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

        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .virtualNetworkName(exampleVirtualNetwork.name())
            .addressPrefixes("10.5.1.0/24")
            .build());

        var exampleVirtualHubIp = new VirtualHubIp("exampleVirtualHubIp", VirtualHubIpArgs.builder()        
            .virtualHubId(exampleVirtualHub.id())
            .privateIpAddress("10.5.1.18")
            .privateIpAllocationMethod("Static")
            .publicIpAddressId(examplePublicIp.id())
            .subnetId(exampleSubnet.id())
            .build());

        var exampleBgpConnection = new BgpConnection("exampleBgpConnection", BgpConnectionArgs.builder()        
            .virtualHubId(exampleVirtualHub.id())
            .peerAsn(65514)
            .peerIp("169.254.21.5")
            .build(), CustomResourceOptions.builder()
                .dependsOn(exampleVirtualHubIp)
                .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    sku="Standard")
example_public_ip = azure.network.PublicIp("examplePublicIp",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    allocation_method="Static",
    sku="Standard")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["10.5.0.0/16"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
example_subnet = azure.network.Subnet("exampleSubnet",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefixes=["10.5.1.0/24"])
example_virtual_hub_ip = azure.network.VirtualHubIp("exampleVirtualHubIp",
    virtual_hub_id=example_virtual_hub.id,
    private_ip_address="10.5.1.18",
    private_ip_allocation_method="Static",
    public_ip_address_id=example_public_ip.id,
    subnet_id=example_subnet.id)
example_bgp_connection = azure.network.BgpConnection("exampleBgpConnection",
    virtual_hub_id=example_virtual_hub.id,
    peer_asn=65514,
    peer_ip="169.254.21.5",
    opts=pulumi.ResourceOptions(depends_on=[example_virtual_hub_ip]))
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    sku: "Standard",
});
const examplePublicIp = new azure.network.PublicIp("examplePublicIp", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    allocationMethod: "Static",
    sku: "Standard",
});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    addressSpaces: ["10.5.0.0/16"],
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
});
const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefixes: ["10.5.1.0/24"],
});
const exampleVirtualHubIp = new azure.network.VirtualHubIp("exampleVirtualHubIp", {
    virtualHubId: exampleVirtualHub.id,
    privateIpAddress: "10.5.1.18",
    privateIpAllocationMethod: "Static",
    publicIpAddressId: examplePublicIp.id,
    subnetId: exampleSubnet.id,
});
const exampleBgpConnection = new azure.network.BgpConnection("exampleBgpConnection", {
    virtualHubId: exampleVirtualHub.id,
    peerAsn: 65514,
    peerIp: "169.254.21.5",
}, {
    dependsOn: [exampleVirtualHubIp],
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleVirtualHub:
    type: azure:network:VirtualHub
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      sku: Standard
  examplePublicIp:
    type: azure:network:PublicIp
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      allocationMethod: Static
      sku: Standard
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      addressSpaces:
        - 10.5.0.0/16
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
  exampleSubnet:
    type: azure:network:Subnet
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.5.1.0/24
  exampleVirtualHubIp:
    type: azure:network:VirtualHubIp
    properties:
      virtualHubId: ${exampleVirtualHub.id}
      privateIpAddress: 10.5.1.18
      privateIpAllocationMethod: Static
      publicIpAddressId: ${examplePublicIp.id}
      subnetId: ${exampleSubnet.id}
  exampleBgpConnection:
    type: azure:network:BgpConnection
    properties:
      virtualHubId: ${exampleVirtualHub.id}
      peerAsn: 65514
      peerIp: 169.254.21.5
    options:
      dependson:
        - ${exampleVirtualHubIp}

Create BgpConnection Resource

new BgpConnection(name: string, args: BgpConnectionArgs, opts?: CustomResourceOptions);
@overload
def BgpConnection(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  name: Optional[str] = None,
                  peer_asn: Optional[int] = None,
                  peer_ip: Optional[str] = None,
                  virtual_hub_id: Optional[str] = None,
                  virtual_network_connection_id: Optional[str] = None)
@overload
def BgpConnection(resource_name: str,
                  args: BgpConnectionArgs,
                  opts: Optional[ResourceOptions] = None)
func NewBgpConnection(ctx *Context, name string, args BgpConnectionArgs, opts ...ResourceOption) (*BgpConnection, error)
public BgpConnection(string name, BgpConnectionArgs args, CustomResourceOptions? opts = null)
public BgpConnection(String name, BgpConnectionArgs args)
public BgpConnection(String name, BgpConnectionArgs args, CustomResourceOptions options)
type: azure:network:BgpConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

PeerAsn int

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

PeerIp string

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

VirtualHubId string

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

Name string

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

VirtualNetworkConnectionId string

The ID of virtual network connection.

PeerAsn int

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

PeerIp string

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

VirtualHubId string

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

Name string

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

VirtualNetworkConnectionId string

The ID of virtual network connection.

peerAsn Integer

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerIp String

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualHubId String

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

name String

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualNetworkConnectionId String

The ID of virtual network connection.

peerAsn number

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerIp string

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualHubId string

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

name string

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualNetworkConnectionId string

The ID of virtual network connection.

peer_asn int

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peer_ip str

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtual_hub_id str

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

name str

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtual_network_connection_id str

The ID of virtual network connection.

peerAsn Number

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerIp String

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualHubId String

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

name String

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualNetworkConnectionId String

The ID of virtual network connection.

Outputs

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

Get an existing BgpConnection 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?: BgpConnectionState, opts?: CustomResourceOptions): BgpConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        peer_asn: Optional[int] = None,
        peer_ip: Optional[str] = None,
        virtual_hub_id: Optional[str] = None,
        virtual_network_connection_id: Optional[str] = None) -> BgpConnection
func GetBgpConnection(ctx *Context, name string, id IDInput, state *BgpConnectionState, opts ...ResourceOption) (*BgpConnection, error)
public static BgpConnection Get(string name, Input<string> id, BgpConnectionState? state, CustomResourceOptions? opts = null)
public static BgpConnection get(String name, Output<String> id, BgpConnectionState 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:
Name string

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

PeerAsn int

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

PeerIp string

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

VirtualHubId string

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

VirtualNetworkConnectionId string

The ID of virtual network connection.

Name string

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

PeerAsn int

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

PeerIp string

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

VirtualHubId string

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

VirtualNetworkConnectionId string

The ID of virtual network connection.

name String

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerAsn Integer

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerIp String

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualHubId String

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

virtualNetworkConnectionId String

The ID of virtual network connection.

name string

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerAsn number

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerIp string

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualHubId string

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

virtualNetworkConnectionId string

The ID of virtual network connection.

name str

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peer_asn int

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peer_ip str

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtual_hub_id str

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

virtual_network_connection_id str

The ID of virtual network connection.

name String

The name which should be used for this Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerAsn Number

The peer autonomous system number for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

peerIp String

The peer IP address for the Virtual Hub Bgp Connection. Changing this forces a new resource to be created.

virtualHubId String

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

virtualNetworkConnectionId String

The ID of virtual network connection.

Import

Virtual Hub Bgp Connections can be imported using the resource id, e.g.

 $ pulumi import azure:network/bgpConnection:BgpConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualHubs/virtualHub1/bgpConnections/connection1

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.