equinix.networkedge.DeviceLink
Explore with Pulumi AI
Example Usage
using System.Collections.Generic;
using Pulumi;
using Equinix = Pulumi.Equinix;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var accountName = config.Require("accountName");
var accountMetro = config.Require("accountMetro");
var device1Id = config.Require("device1Id");
var device2Id = config.Require("device2Id");
var accountfNum = Equinix.NetworkEdge.GetAccount.Invoke(new()
{
Name = accountName,
MetroCode = accountMetro,
}).Apply(invoke => invoke.Number);
var device1Metro = Equinix.NetworkEdge.GetDevice.Invoke(new()
{
Uuid = device1Id,
}).Apply(invoke => invoke.MetroCode);
var device2Metro = Equinix.NetworkEdge.GetDevice.Invoke(new()
{
Uuid = device2Id,
}).Apply(invoke => invoke.MetroCode);
var deviceLink = new Equinix.NetworkEdge.DeviceLink("deviceLink", new()
{
Name = "test-link",
Subnet = "192.168.40.64/27",
Devices = new[]
{
new Equinix.NetworkEdge.Inputs.DeviceLinkDeviceArgs
{
Id = "device1Id",
Asn = 22111,
InterfaceId = 6,
},
new Equinix.NetworkEdge.Inputs.DeviceLinkDeviceArgs
{
Id = "device2Id",
Asn = 22333,
InterfaceId = 7,
},
},
Links = new[]
{
new Equinix.NetworkEdge.Inputs.DeviceLinkLinkArgs
{
AccountNumber = accountfNum,
SrcMetroCode = device1Metro,
DstMetroCode = device2Metro,
Throughput = "50",
ThroughputUnit = "Mbps",
},
},
});
return new Dictionary<string, object?>
{
["status"] = deviceLink.Status,
["devices"] = deviceLink.Devices,
};
});
package main
import (
"github.com/equinix/pulumi-equinix/sdk/go/equinix/networkedge"
"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, "")
accountName := cfg.Require("accountName")
accountMetro := cfg.Require("accountMetro")
device1Id := cfg.Require("device1Id")
device2Id := cfg.Require("device2Id")
accountfNum := networkedge.GetAccount(ctx, &networkedge.GetAccountArgs{
Name: pulumi.StringRef(accountName),
MetroCode: accountMetro,
}, nil).Number
device1Metro := networkedge.LookupDevice(ctx, &networkedge.LookupDeviceArgs{
Uuid: pulumi.StringRef(device1Id),
}, nil).MetroCode
device2Metro := networkedge.LookupDevice(ctx, &networkedge.LookupDeviceArgs{
Uuid: pulumi.StringRef(device2Id),
}, nil).MetroCode
deviceLink, err := networkedge.NewDeviceLink(ctx, "deviceLink", &networkedge.DeviceLinkArgs{
Name: pulumi.String("test-link"),
Subnet: pulumi.String("192.168.40.64/27"),
Devices: networkedge.DeviceLinkDeviceArray{
&networkedge.DeviceLinkDeviceArgs{
Id: pulumi.String("device1Id"),
Asn: pulumi.Int(22111),
InterfaceId: pulumi.Int(6),
},
&networkedge.DeviceLinkDeviceArgs{
Id: pulumi.String("device2Id"),
Asn: pulumi.Int(22333),
InterfaceId: pulumi.Int(7),
},
},
Links: networkedge.DeviceLinkLinkArray{
&networkedge.DeviceLinkLinkArgs{
AccountNumber: *pulumi.String(accountfNum),
SrcMetroCode: *pulumi.String(device1Metro),
DstMetroCode: *pulumi.String(device2Metro),
Throughput: pulumi.String("50"),
ThroughputUnit: pulumi.String("Mbps"),
},
},
})
if err != nil {
return err
}
ctx.Export("status", deviceLink.Status)
ctx.Export("devices", deviceLink.Devices)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.equinix.pulumi.networkedge.DeviceLink;
import com.equinix.pulumi.networkedge.DeviceLinkArgs;
import com.equinix.pulumi.networkedge.inputs.DeviceLinkDeviceArgs;
import com.equinix.pulumi.networkedge.inputs.DeviceLinkLinkArgs;
import com.equinix.pulumi.networkedge.inputs.GetAccountArgs;
import com.equinix.pulumi.networkedge.inputs.GetDeviceArgs;
import com.equinix.pulumi.networkedge.NetworkedgeFunctions;
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 accountName = config.get("accountName").get();
final var accountMetro = config.get("accountMetro").get();
final var device1Id = config.get("device1Id").get();
final var device2Id = config.get("device2Id").get();
final var accountfNum = NetworkedgeFunctions.getAccount(GetAccountArgs.builder()
.name(accountName)
.metroCode(accountMetro)
.build()).applyValue(account -> account.number());
final var device1Metro = NetworkedgeFunctions.getDevice(GetDeviceArgs.builder()
.uuid(device1Id)
.build()).applyValue(device -> device.metroCode());
final var device2Metro = NetworkedgeFunctions.getDevice(GetDeviceArgs.builder()
.uuid(device2Id)
.build()).applyValue(device -> device.metroCode());
var deviceLink = new DeviceLink("deviceLink", DeviceLinkArgs.builder()
.name("test-link")
.subnet("192.168.40.64/27")
.devices(
DeviceLinkDeviceArgs.builder()
.id("device1Id")
.asn(22111)
.interfaceId(6)
.build(),
DeviceLinkDeviceArgs.builder()
.id("device2Id")
.asn(22333)
.interfaceId(7)
.build())
.links(DeviceLinkLinkArgs.builder()
.accountNumber(accountfNum)
.srcMetroCode(device1Metro)
.dstMetroCode(device2Metro)
.throughput("50")
.throughputUnit("Mbps")
.build())
.build());
ctx.export("status", deviceLink.status());
ctx.export("devices", deviceLink.devices());
}
}
import pulumi
import pulumi_equinix as equinix
config = pulumi.Config()
account_name = config.require("accountName")
account_metro = config.require("accountMetro")
device1_id = config.require("device1Id")
device2_id = config.require("device2Id")
accountf_num = equinix.networkedge.get_account(name=account_name,
metro_code=account_metro).number
device1_metro = equinix.networkedge.get_device(uuid=device1_id).metro_code
device2_metro = equinix.networkedge.get_device(uuid=device2_id).metro_code
device_link = equinix.networkedge.DeviceLink("deviceLink",
name="test-link",
subnet="192.168.40.64/27",
devices=[
equinix.networkedge.DeviceLinkDeviceArgs(
id="device1Id",
asn=22111,
interface_id=6,
),
equinix.networkedge.DeviceLinkDeviceArgs(
id="device2Id",
asn=22333,
interface_id=7,
),
],
links=[equinix.networkedge.DeviceLinkLinkArgs(
account_number=accountf_num,
src_metro_code=device1_metro,
dst_metro_code=device2_metro,
throughput="50",
throughput_unit="Mbps",
)])
pulumi.export("status", device_link.status)
pulumi.export("devices", device_link.devices)
import * as pulumi from "@pulumi/pulumi";
import * as equinix from "@equinix-labs/pulumi-equinix";
const config = new pulumi.Config();
const accountName = config.require("accountName");
const accountMetro = config.require("accountMetro");
const device1Id = config.require("device1Id");
const device2Id = config.require("device2Id");
const accountfNum = equinix.networkedge.getAccount({
name: accountName,
metroCode: accountMetro,
}).then(invoke => invoke.number);
const device1Metro = equinix.networkedge.getDevice({
uuid: device1Id,
}).then(invoke => invoke.metroCode);
const device2Metro = equinix.networkedge.getDevice({
uuid: device2Id,
}).then(invoke => invoke.metroCode);
const deviceLink = new equinix.networkedge.DeviceLink("deviceLink", {
name: "test-link",
subnet: "192.168.40.64/27",
devices: [
{
id: "device1Id",
asn: 22111,
interfaceId: 6,
},
{
id: "device2Id",
asn: 22333,
interfaceId: 7,
},
],
links: [{
accountNumber: accountfNum,
srcMetroCode: device1Metro,
dstMetroCode: device2Metro,
throughput: "50",
throughputUnit: "Mbps",
}],
});
export const status = deviceLink.status;
export const devices = deviceLink.devices;
config:
accountName:
type: string
accountMetro:
type: string
device1Id:
type: string
device2Id:
type: string
variables:
accountfNum:
fn::invoke:
function: equinix:networkedge:getAccount
arguments:
name: ${accountName}
metroCode: ${accountMetro}
return: number
device1Metro:
fn::invoke:
function: equinix:networkedge:getDevice
arguments:
uuid: ${device1Id}
return: metroCode
device2Metro:
fn::invoke:
function: equinix:networkedge:getDevice
arguments:
uuid: ${device2Id}
return: metroCode
resources:
deviceLink:
type: equinix:networkedge:DeviceLink
properties:
name: test-link
subnet: 192.168.40.64/27
devices:
- id: device1Id
asn: 22111
interfaceId: 6
- id: device2Id
asn: 22333
interfaceId: 7
links:
- accountNumber: ${accountfNum}
srcMetroCode: ${device1Metro}
dstMetroCode: ${device2Metro}
throughput: 50
throughputUnit: Mbps
outputs:
status: ${deviceLink.status}
devices: ${deviceLink.devices}
Create DeviceLink Resource
new DeviceLink(name: string, args: DeviceLinkArgs, opts?: CustomResourceOptions);
@overload
def DeviceLink(resource_name: str,
opts: Optional[ResourceOptions] = None,
devices: Optional[Sequence[DeviceLinkDeviceArgs]] = None,
links: Optional[Sequence[DeviceLinkLinkArgs]] = None,
name: Optional[str] = None,
subnet: Optional[str] = None)
@overload
def DeviceLink(resource_name: str,
args: DeviceLinkArgs,
opts: Optional[ResourceOptions] = None)
func NewDeviceLink(ctx *Context, name string, args DeviceLinkArgs, opts ...ResourceOption) (*DeviceLink, error)
public DeviceLink(string name, DeviceLinkArgs args, CustomResourceOptions? opts = null)
public DeviceLink(String name, DeviceLinkArgs args)
public DeviceLink(String name, DeviceLinkArgs args, CustomResourceOptions options)
type: equinix:networkedge:DeviceLink
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeviceLinkArgs
- 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 DeviceLinkArgs
- 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 DeviceLinkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeviceLinkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DeviceLinkArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
DeviceLink 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 DeviceLink resource accepts the following input properties:
- Devices
List<Device
Link Device Args> definition of one or more devices belonging to the device link. See Device section below for more details.
- Links
List<Device
Link Link Args> definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- Name string
device link name.
- Subnet string
device link subnet in CIDR format. Not required for link between self configured devices.
- Devices
[]Device
Link Device Args definition of one or more devices belonging to the device link. See Device section below for more details.
- Links
[]Device
Link Link Args definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- Name string
device link name.
- Subnet string
device link subnet in CIDR format. Not required for link between self configured devices.
- devices
List<Device
Link Device Args> definition of one or more devices belonging to the device link. See Device section below for more details.
- links
List<Device
Link Link Args> definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- name String
device link name.
- subnet String
device link subnet in CIDR format. Not required for link between self configured devices.
- devices
Device
Link Device Args[] definition of one or more devices belonging to the device link. See Device section below for more details.
- links
Device
Link Link Args[] definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- name string
device link name.
- subnet string
device link subnet in CIDR format. Not required for link between self configured devices.
- devices
Sequence[Device
Link Device Args] definition of one or more devices belonging to the device link. See Device section below for more details.
- links
Sequence[Device
Link Link Args] definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- name str
device link name.
- subnet str
device link subnet in CIDR format. Not required for link between self configured devices.
- devices List<Property Map>
definition of one or more devices belonging to the device link. See Device section below for more details.
- links List<Property Map>
definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- name String
device link name.
- subnet String
device link subnet in CIDR format. Not required for link between self configured devices.
Outputs
All input properties are implicitly available as output properties. Additionally, the DeviceLink resource produces the following output properties:
Look up Existing DeviceLink Resource
Get an existing DeviceLink 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?: DeviceLinkState, opts?: CustomResourceOptions): DeviceLink
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
devices: Optional[Sequence[DeviceLinkDeviceArgs]] = None,
links: Optional[Sequence[DeviceLinkLinkArgs]] = None,
name: Optional[str] = None,
status: Optional[str] = None,
subnet: Optional[str] = None,
uuid: Optional[str] = None) -> DeviceLink
func GetDeviceLink(ctx *Context, name string, id IDInput, state *DeviceLinkState, opts ...ResourceOption) (*DeviceLink, error)
public static DeviceLink Get(string name, Input<string> id, DeviceLinkState? state, CustomResourceOptions? opts = null)
public static DeviceLink get(String name, Output<String> id, DeviceLinkState 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.
- Devices
List<Device
Link Device Args> definition of one or more devices belonging to the device link. See Device section below for more details.
- Links
List<Device
Link Link Args> definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- Name string
device link name.
- Status string
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.- Subnet string
device link subnet in CIDR format. Not required for link between self configured devices.
- Uuid string
Device link unique identifier.
- Devices
[]Device
Link Device Args definition of one or more devices belonging to the device link. See Device section below for more details.
- Links
[]Device
Link Link Args definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- Name string
device link name.
- Status string
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.- Subnet string
device link subnet in CIDR format. Not required for link between self configured devices.
- Uuid string
Device link unique identifier.
- devices
List<Device
Link Device Args> definition of one or more devices belonging to the device link. See Device section below for more details.
- links
List<Device
Link Link Args> definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- name String
device link name.
- status String
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.- subnet String
device link subnet in CIDR format. Not required for link between self configured devices.
- uuid String
Device link unique identifier.
- devices
Device
Link Device Args[] definition of one or more devices belonging to the device link. See Device section below for more details.
- links
Device
Link Link Args[] definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- name string
device link name.
- status string
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.- subnet string
device link subnet in CIDR format. Not required for link between self configured devices.
- uuid string
Device link unique identifier.
- devices
Sequence[Device
Link Device Args] definition of one or more devices belonging to the device link. See Device section below for more details.
- links
Sequence[Device
Link Link Args] definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- name str
device link name.
- status str
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.- subnet str
device link subnet in CIDR format. Not required for link between self configured devices.
- uuid str
Device link unique identifier.
- devices List<Property Map>
definition of one or more devices belonging to the device link. See Device section below for more details.
- links List<Property Map>
definition of one or more, inter metro, connections belonging to the device link. See Link section below for more details.
- name String
device link name.
- status String
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.- subnet String
device link subnet in CIDR format. Not required for link between self configured devices.
- uuid String
Device link unique identifier.
Supporting Types
DeviceLinkDevice
- Id string
Device identifier.
- Asn int
Device ASN number. Not required for self configured devices.
- Interface
Id int Device network interface identifier to use for device link connection.
- Ip
Address string IP address from device link subnet that was assigned to the device
- Status string
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.
- Id string
Device identifier.
- Asn int
Device ASN number. Not required for self configured devices.
- Interface
Id int Device network interface identifier to use for device link connection.
- Ip
Address string IP address from device link subnet that was assigned to the device
- Status string
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.
- id String
Device identifier.
- asn Integer
Device ASN number. Not required for self configured devices.
- interface
Id Integer Device network interface identifier to use for device link connection.
- ip
Address String IP address from device link subnet that was assigned to the device
- status String
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.
- id string
Device identifier.
- asn number
Device ASN number. Not required for self configured devices.
- interface
Id number Device network interface identifier to use for device link connection.
- ip
Address string IP address from device link subnet that was assigned to the device
- status string
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.
- id str
Device identifier.
- asn int
Device ASN number. Not required for self configured devices.
- interface_
id int Device network interface identifier to use for device link connection.
- ip_
address str IP address from device link subnet that was assigned to the device
- status str
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.
- id String
Device identifier.
- asn Number
Device ASN number. Not required for self configured devices.
- interface
Id Number Device network interface identifier to use for device link connection.
- ip
Address String IP address from device link subnet that was assigned to the device
- status String
device link provisioning status on a given device. One of
PROVISIONING
,PROVISIONED
,DEPROVISIONING
,DEPROVISIONED
,FAILED
.
DeviceLinkLink
- Account
Number string billing account number to be used for connection charges
- Dst
Metro stringCode connection destination metro code.
- Src
Metro stringCode connection source metro code.
- Throughput string
connection throughput.
- Throughput
Unit string connection throughput unit (Mbps or Gbps).
- Dst
Zone stringCode connection destination zone code is not required.
DestinationZoneCode is not required
- Src
Zone stringCode connection source zone code is not required.
SourceZoneCode is not required
- Account
Number string billing account number to be used for connection charges
- Dst
Metro stringCode connection destination metro code.
- Src
Metro stringCode connection source metro code.
- Throughput string
connection throughput.
- Throughput
Unit string connection throughput unit (Mbps or Gbps).
- Dst
Zone stringCode connection destination zone code is not required.
DestinationZoneCode is not required
- Src
Zone stringCode connection source zone code is not required.
SourceZoneCode is not required
- account
Number String billing account number to be used for connection charges
- dst
Metro StringCode connection destination metro code.
- src
Metro StringCode connection source metro code.
- throughput String
connection throughput.
- throughput
Unit String connection throughput unit (Mbps or Gbps).
- dst
Zone StringCode connection destination zone code is not required.
DestinationZoneCode is not required
- src
Zone StringCode connection source zone code is not required.
SourceZoneCode is not required
- account
Number string billing account number to be used for connection charges
- dst
Metro stringCode connection destination metro code.
- src
Metro stringCode connection source metro code.
- throughput string
connection throughput.
- throughput
Unit string connection throughput unit (Mbps or Gbps).
- dst
Zone stringCode connection destination zone code is not required.
DestinationZoneCode is not required
- src
Zone stringCode connection source zone code is not required.
SourceZoneCode is not required
- account_
number str billing account number to be used for connection charges
- dst_
metro_ strcode connection destination metro code.
- src_
metro_ strcode connection source metro code.
- throughput str
connection throughput.
- throughput_
unit str connection throughput unit (Mbps or Gbps).
- dst_
zone_ strcode connection destination zone code is not required.
DestinationZoneCode is not required
- src_
zone_ strcode connection source zone code is not required.
SourceZoneCode is not required
- account
Number String billing account number to be used for connection charges
- dst
Metro StringCode connection destination metro code.
- src
Metro StringCode connection source metro code.
- throughput String
connection throughput.
- throughput
Unit String connection throughput unit (Mbps or Gbps).
- dst
Zone StringCode connection destination zone code is not required.
DestinationZoneCode is not required
- src
Zone StringCode connection source zone code is not required.
SourceZoneCode is not required
Package Details
- Repository
- equinix equinix/pulumi-equinix
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
equinix
Terraform Provider.