alicloud.vpc.BgpNetwork
Explore with Pulumi AI
Provides a Express Connect Bgp Network resource.
For information about Express Connect Bgp Network and how to use it, see What is Bgp Network.
NOTE: Available since v1.153.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = alicloud.expressconnect.getPhysicalConnections({
nameRegex: "^preserved-NODELETING",
});
const defaultInteger = new random.index.Integer("default", {
min: 1,
max: 2999,
});
const defaultVirtualBorderRouter = new alicloud.expressconnect.VirtualBorderRouter("default", {
localGatewayIp: "10.0.0.1",
peerGatewayIp: "10.0.0.2",
peeringSubnetMask: "255.255.255.252",
physicalConnectionId: _default.then(_default => _default.connections?.[0]?.id),
virtualBorderRouterName: name,
vlanId: defaultInteger.id,
minRxInterval: 1000,
minTxInterval: 1000,
detectMultiplier: 10,
});
const defaultBgpNetwork = new alicloud.vpc.BgpNetwork("default", {
dstCidrBlock: "192.168.0.0/24",
routerId: defaultVirtualBorderRouter.id,
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.expressconnect.get_physical_connections(name_regex="^preserved-NODELETING")
default_integer = random.index.Integer("default",
min=1,
max=2999)
default_virtual_border_router = alicloud.expressconnect.VirtualBorderRouter("default",
local_gateway_ip="10.0.0.1",
peer_gateway_ip="10.0.0.2",
peering_subnet_mask="255.255.255.252",
physical_connection_id=default.connections[0].id,
virtual_border_router_name=name,
vlan_id=default_integer["id"],
min_rx_interval=1000,
min_tx_interval=1000,
detect_multiplier=10)
default_bgp_network = alicloud.vpc.BgpNetwork("default",
dst_cidr_block="192.168.0.0/24",
router_id=default_virtual_border_router.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/expressconnect"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := expressconnect.GetPhysicalConnections(ctx, &expressconnect.GetPhysicalConnectionsArgs{
NameRegex: pulumi.StringRef("^preserved-NODELETING"),
}, nil)
if err != nil {
return err
}
defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 1,
Max: 2999,
})
if err != nil {
return err
}
defaultVirtualBorderRouter, err := expressconnect.NewVirtualBorderRouter(ctx, "default", &expressconnect.VirtualBorderRouterArgs{
LocalGatewayIp: pulumi.String("10.0.0.1"),
PeerGatewayIp: pulumi.String("10.0.0.2"),
PeeringSubnetMask: pulumi.String("255.255.255.252"),
PhysicalConnectionId: pulumi.String(_default.Connections[0].Id),
VirtualBorderRouterName: pulumi.String(name),
VlanId: defaultInteger.Id,
MinRxInterval: pulumi.Int(1000),
MinTxInterval: pulumi.Int(1000),
DetectMultiplier: pulumi.Int(10),
})
if err != nil {
return err
}
_, err = vpc.NewBgpNetwork(ctx, "default", &vpc.BgpNetworkArgs{
DstCidrBlock: pulumi.String("192.168.0.0/24"),
RouterId: defaultVirtualBorderRouter.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = AliCloud.ExpressConnect.GetPhysicalConnections.Invoke(new()
{
NameRegex = "^preserved-NODELETING",
});
var defaultInteger = new Random.Index.Integer("default", new()
{
Min = 1,
Max = 2999,
});
var defaultVirtualBorderRouter = new AliCloud.ExpressConnect.VirtualBorderRouter("default", new()
{
LocalGatewayIp = "10.0.0.1",
PeerGatewayIp = "10.0.0.2",
PeeringSubnetMask = "255.255.255.252",
PhysicalConnectionId = @default.Apply(@default => @default.Apply(getPhysicalConnectionsResult => getPhysicalConnectionsResult.Connections[0]?.Id)),
VirtualBorderRouterName = name,
VlanId = defaultInteger.Id,
MinRxInterval = 1000,
MinTxInterval = 1000,
DetectMultiplier = 10,
});
var defaultBgpNetwork = new AliCloud.Vpc.BgpNetwork("default", new()
{
DstCidrBlock = "192.168.0.0/24",
RouterId = defaultVirtualBorderRouter.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.expressconnect.ExpressconnectFunctions;
import com.pulumi.alicloud.expressconnect.inputs.GetPhysicalConnectionsArgs;
import com.pulumi.random.Integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.expressconnect.VirtualBorderRouter;
import com.pulumi.alicloud.expressconnect.VirtualBorderRouterArgs;
import com.pulumi.alicloud.vpc.BgpNetwork;
import com.pulumi.alicloud.vpc.BgpNetworkArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var default = ExpressconnectFunctions.getPhysicalConnections(GetPhysicalConnectionsArgs.builder()
.nameRegex("^preserved-NODELETING")
.build());
var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
.min(1)
.max(2999)
.build());
var defaultVirtualBorderRouter = new VirtualBorderRouter("defaultVirtualBorderRouter", VirtualBorderRouterArgs.builder()
.localGatewayIp("10.0.0.1")
.peerGatewayIp("10.0.0.2")
.peeringSubnetMask("255.255.255.252")
.physicalConnectionId(default_.connections()[0].id())
.virtualBorderRouterName(name)
.vlanId(defaultInteger.id())
.minRxInterval(1000)
.minTxInterval(1000)
.detectMultiplier(10)
.build());
var defaultBgpNetwork = new BgpNetwork("defaultBgpNetwork", BgpNetworkArgs.builder()
.dstCidrBlock("192.168.0.0/24")
.routerId(defaultVirtualBorderRouter.id())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultInteger:
type: random:Integer
name: default
properties:
min: 1
max: 2999
defaultVirtualBorderRouter:
type: alicloud:expressconnect:VirtualBorderRouter
name: default
properties:
localGatewayIp: 10.0.0.1
peerGatewayIp: 10.0.0.2
peeringSubnetMask: 255.255.255.252
physicalConnectionId: ${default.connections[0].id}
virtualBorderRouterName: ${name}
vlanId: ${defaultInteger.id}
minRxInterval: 1000
minTxInterval: 1000
detectMultiplier: 10
defaultBgpNetwork:
type: alicloud:vpc:BgpNetwork
name: default
properties:
dstCidrBlock: 192.168.0.0/24
routerId: ${defaultVirtualBorderRouter.id}
variables:
default:
fn::invoke:
function: alicloud:expressconnect:getPhysicalConnections
arguments:
nameRegex: ^preserved-NODELETING
Create BgpNetwork Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BgpNetwork(name: string, args: BgpNetworkArgs, opts?: CustomResourceOptions);
@overload
def BgpNetwork(resource_name: str,
args: BgpNetworkArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BgpNetwork(resource_name: str,
opts: Optional[ResourceOptions] = None,
dst_cidr_block: Optional[str] = None,
router_id: Optional[str] = None,
vpc_id: Optional[str] = None)
func NewBgpNetwork(ctx *Context, name string, args BgpNetworkArgs, opts ...ResourceOption) (*BgpNetwork, error)
public BgpNetwork(string name, BgpNetworkArgs args, CustomResourceOptions? opts = null)
public BgpNetwork(String name, BgpNetworkArgs args)
public BgpNetwork(String name, BgpNetworkArgs args, CustomResourceOptions options)
type: alicloud:vpc:BgpNetwork
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 BgpNetworkArgs
- 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 BgpNetworkArgs
- 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 BgpNetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BgpNetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BgpNetworkArgs
- 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 bgpNetworkResource = new AliCloud.Vpc.BgpNetwork("bgpNetworkResource", new()
{
DstCidrBlock = "string",
RouterId = "string",
VpcId = "string",
});
example, err := vpc.NewBgpNetwork(ctx, "bgpNetworkResource", &vpc.BgpNetworkArgs{
DstCidrBlock: pulumi.String("string"),
RouterId: pulumi.String("string"),
VpcId: pulumi.String("string"),
})
var bgpNetworkResource = new BgpNetwork("bgpNetworkResource", BgpNetworkArgs.builder()
.dstCidrBlock("string")
.routerId("string")
.vpcId("string")
.build());
bgp_network_resource = alicloud.vpc.BgpNetwork("bgpNetworkResource",
dst_cidr_block="string",
router_id="string",
vpc_id="string")
const bgpNetworkResource = new alicloud.vpc.BgpNetwork("bgpNetworkResource", {
dstCidrBlock: "string",
routerId: "string",
vpcId: "string",
});
type: alicloud:vpc:BgpNetwork
properties:
dstCidrBlock: string
routerId: string
vpcId: string
BgpNetwork 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 BgpNetwork resource accepts the following input properties:
- Dst
Cidr stringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- Router
Id string - The region ID of the virtual border router (VBR) group.
- Vpc
Id string - The ID of the VPC.
- Dst
Cidr stringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- Router
Id string - The region ID of the virtual border router (VBR) group.
- Vpc
Id string - The ID of the VPC.
- dst
Cidr StringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- router
Id String - The region ID of the virtual border router (VBR) group.
- vpc
Id String - The ID of the VPC.
- dst
Cidr stringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- router
Id string - The region ID of the virtual border router (VBR) group.
- vpc
Id string - The ID of the VPC.
- dst_
cidr_ strblock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- router_
id str - The region ID of the virtual border router (VBR) group.
- vpc_
id str - The ID of the VPC.
- dst
Cidr StringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- router
Id String - The region ID of the virtual border router (VBR) group.
- vpc
Id String - The ID of the VPC.
Outputs
All input properties are implicitly available as output properties. Additionally, the BgpNetwork resource produces the following output properties:
Look up Existing BgpNetwork Resource
Get an existing BgpNetwork 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?: BgpNetworkState, opts?: CustomResourceOptions): BgpNetwork
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dst_cidr_block: Optional[str] = None,
router_id: Optional[str] = None,
status: Optional[str] = None,
vpc_id: Optional[str] = None) -> BgpNetwork
func GetBgpNetwork(ctx *Context, name string, id IDInput, state *BgpNetworkState, opts ...ResourceOption) (*BgpNetwork, error)
public static BgpNetwork Get(string name, Input<string> id, BgpNetworkState? state, CustomResourceOptions? opts = null)
public static BgpNetwork get(String name, Output<String> id, BgpNetworkState state, CustomResourceOptions options)
resources: _: type: alicloud:vpc:BgpNetwork 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.
- Dst
Cidr stringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- Router
Id string - The region ID of the virtual border router (VBR) group.
- Status string
- The state of the advertised BGP network.
- Vpc
Id string - The ID of the VPC.
- Dst
Cidr stringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- Router
Id string - The region ID of the virtual border router (VBR) group.
- Status string
- The state of the advertised BGP network.
- Vpc
Id string - The ID of the VPC.
- dst
Cidr StringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- router
Id String - The region ID of the virtual border router (VBR) group.
- status String
- The state of the advertised BGP network.
- vpc
Id String - The ID of the VPC.
- dst
Cidr stringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- router
Id string - The region ID of the virtual border router (VBR) group.
- status string
- The state of the advertised BGP network.
- vpc
Id string - The ID of the VPC.
- dst_
cidr_ strblock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- router_
id str - The region ID of the virtual border router (VBR) group.
- status str
- The state of the advertised BGP network.
- vpc_
id str - The ID of the VPC.
- dst
Cidr StringBlock - The CIDR block of the virtual private cloud (VPC) or vSwitch that you want to connect to a data center.
- router
Id String - The region ID of the virtual border router (VBR) group.
- status String
- The state of the advertised BGP network.
- vpc
Id String - The ID of the VPC.
Import
Express Connect Bgp Network can be imported using the id, e.g.
$ pulumi import alicloud:vpc/bgpNetwork:BgpNetwork example <router_id>:<dst_cidr_block>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.