equinix.metal.BgpSession
Explore with Pulumi AI
Provides a resource to manage BGP sessions in Equinix Metal Host. Refer to Equinix Metal BGP documentation for more details.
You need to have BGP config enabled in your project.
BGP session must be linked to a device running BIRD or other BGP routing daemon which will control route advertisements via the session to Equinix Metal’s upstream routers.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Equinix = Pulumi.Equinix;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var deviceId = config.Require("deviceId");
var bgp = new Equinix.Metal.BgpSession("bgp", new()
{
DeviceId = deviceId,
AddressFamily = "ipv4",
});
return new Dictionary<string, object?>
{
["bgpSessionStatus"] = bgp.Status,
};
});
package main
import (
"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
"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, "")
deviceId := cfg.Require("deviceId")
bgp, err := metal.NewBgpSession(ctx, "bgp", &metal.BgpSessionArgs{
DeviceId: pulumi.String(deviceId),
AddressFamily: pulumi.String("ipv4"),
})
if err != nil {
return err
}
ctx.Export("bgpSessionStatus", bgp.Status)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.equinix.pulumi.metal.BgpSession;
import com.equinix.pulumi.metal.BgpSessionArgs;
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 deviceId = config.get("deviceId").get();
var bgp = new BgpSession("bgp", BgpSessionArgs.builder()
.deviceId(deviceId)
.addressFamily("ipv4")
.build());
ctx.export("bgpSessionStatus", bgp.status());
}
}
import pulumi
import pulumi_equinix as equinix
config = pulumi.Config()
device_id = config.require("deviceId")
bgp = equinix.metal.BgpSession("bgp",
device_id=device_id,
address_family="ipv4")
pulumi.export("bgpSessionStatus", bgp.status)
import * as pulumi from "@pulumi/pulumi";
import * as equinix from "@equinix-labs/pulumi-equinix";
const config = new pulumi.Config();
const deviceId = config.require("deviceId");
const bgp = new equinix.metal.BgpSession("bgp", {
deviceId: deviceId,
addressFamily: "ipv4",
});
export const bgpSessionStatus = bgp.status;
config:
deviceId:
type: string
resources:
bgp:
type: equinix:metal:BgpSession
properties:
deviceId: ${deviceId}
addressFamily: ipv4
outputs:
bgpSessionStatus: ${bgp.status}
Create BgpSession Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BgpSession(name: string, args: BgpSessionArgs, opts?: CustomResourceOptions);
@overload
def BgpSession(resource_name: str,
args: BgpSessionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BgpSession(resource_name: str,
opts: Optional[ResourceOptions] = None,
address_family: Optional[str] = None,
device_id: Optional[str] = None,
default_route: Optional[bool] = None)
func NewBgpSession(ctx *Context, name string, args BgpSessionArgs, opts ...ResourceOption) (*BgpSession, error)
public BgpSession(string name, BgpSessionArgs args, CustomResourceOptions? opts = null)
public BgpSession(String name, BgpSessionArgs args)
public BgpSession(String name, BgpSessionArgs args, CustomResourceOptions options)
type: equinix:metal:BgpSession
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 BgpSessionArgs
- 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 BgpSessionArgs
- 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 BgpSessionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BgpSessionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BgpSessionArgs
- 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 bgpSessionResource = new Equinix.Metal.BgpSession("bgpSessionResource", new()
{
AddressFamily = "string",
DeviceId = "string",
DefaultRoute = false,
});
example, err := metal.NewBgpSession(ctx, "bgpSessionResource", &metal.BgpSessionArgs{
AddressFamily: pulumi.String("string"),
DeviceId: pulumi.String("string"),
DefaultRoute: pulumi.Bool(false),
})
var bgpSessionResource = new BgpSession("bgpSessionResource", BgpSessionArgs.builder()
.addressFamily("string")
.deviceId("string")
.defaultRoute(false)
.build());
bgp_session_resource = equinix.metal.BgpSession("bgpSessionResource",
address_family="string",
device_id="string",
default_route=False)
const bgpSessionResource = new equinix.metal.BgpSession("bgpSessionResource", {
addressFamily: "string",
deviceId: "string",
defaultRoute: false,
});
type: equinix:metal:BgpSession
properties:
addressFamily: string
defaultRoute: false
deviceId: string
BgpSession 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 BgpSession resource accepts the following input properties:
- Address
Family string ipv4
oripv6
.- Device
Id string - ID of device.
- Default
Route bool - Boolean flag to set the default route policy. False by default.
- Address
Family string ipv4
oripv6
.- Device
Id string - ID of device.
- Default
Route bool - Boolean flag to set the default route policy. False by default.
- address
Family String ipv4
oripv6
.- device
Id String - ID of device.
- default
Route Boolean - Boolean flag to set the default route policy. False by default.
- address
Family string ipv4
oripv6
.- device
Id string - ID of device.
- default
Route boolean - Boolean flag to set the default route policy. False by default.
- address_
family str ipv4
oripv6
.- device_
id str - ID of device.
- default_
route bool - Boolean flag to set the default route policy. False by default.
- address
Family String ipv4
oripv6
.- device
Id String - ID of device.
- default
Route Boolean - Boolean flag to set the default route policy. False by default.
Outputs
All input properties are implicitly available as output properties. Additionally, the BgpSession resource produces the following output properties:
Look up Existing BgpSession Resource
Get an existing BgpSession 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?: BgpSessionState, opts?: CustomResourceOptions): BgpSession
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address_family: Optional[str] = None,
default_route: Optional[bool] = None,
device_id: Optional[str] = None,
status: Optional[str] = None) -> BgpSession
func GetBgpSession(ctx *Context, name string, id IDInput, state *BgpSessionState, opts ...ResourceOption) (*BgpSession, error)
public static BgpSession Get(string name, Input<string> id, BgpSessionState? state, CustomResourceOptions? opts = null)
public static BgpSession get(String name, Output<String> id, BgpSessionState 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.
- Address
Family string ipv4
oripv6
.- Default
Route bool - Boolean flag to set the default route policy. False by default.
- Device
Id string - ID of device.
- Status string
- Status of the session -
up
ordown
- Address
Family string ipv4
oripv6
.- Default
Route bool - Boolean flag to set the default route policy. False by default.
- Device
Id string - ID of device.
- Status string
- Status of the session -
up
ordown
- address
Family String ipv4
oripv6
.- default
Route Boolean - Boolean flag to set the default route policy. False by default.
- device
Id String - ID of device.
- status String
- Status of the session -
up
ordown
- address
Family string ipv4
oripv6
.- default
Route boolean - Boolean flag to set the default route policy. False by default.
- device
Id string - ID of device.
- status string
- Status of the session -
up
ordown
- address_
family str ipv4
oripv6
.- default_
route bool - Boolean flag to set the default route policy. False by default.
- device_
id str - ID of device.
- status str
- Status of the session -
up
ordown
- address
Family String ipv4
oripv6
.- default
Route Boolean - Boolean flag to set the default route policy. False by default.
- device
Id String - ID of device.
- status String
- Status of the session -
up
ordown
Package Details
- Repository
- equinix equinix/pulumi-equinix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
equinix
Terraform Provider.