1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. DeviceNetworkType
Equinix v0.21.0 published on Friday, Feb 28, 2025 by Equinix

equinix.metal.DeviceNetworkType

Explore with Pulumi AI

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var deviceId = config.Require("deviceId");
    var networkType = config.Get("networkType") ?? "hybrid";
    var deviceNetwork = new Equinix.Metal.DeviceNetworkType("deviceNetwork", new()
    {
        DeviceId = deviceId,
        Type = networkType,
    });

    return new Dictionary<string, object?>
    {
        ["deviceNetworkId"] = deviceNetwork.Id,
    };
});
Copy
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")
		networkType := "hybrid"
		if param := cfg.Get("networkType"); param != "" {
			networkType = param
		}
		deviceNetwork, err := metal.NewDeviceNetworkType(ctx, "deviceNetwork", &metal.DeviceNetworkTypeArgs{
			DeviceId: pulumi.String(deviceId),
			Type:     pulumi.String(networkType),
		})
		if err != nil {
			return err
		}
		ctx.Export("deviceNetworkId", deviceNetwork.ID())
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.equinix.metal.DeviceNetworkType;
import com.pulumi.equinix.metal.DeviceNetworkTypeArgs;
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 deviceId = config.get("deviceId");
        final var networkType = config.get("networkType").orElse("hybrid");
        var deviceNetwork = new DeviceNetworkType("deviceNetwork", DeviceNetworkTypeArgs.builder()
            .deviceId(deviceId)
            .type(networkType)
            .build());

        ctx.export("deviceNetworkId", deviceNetwork.id());
    }
}
Copy
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 networkType = config.get("networkType") || "hybrid";
const deviceNetwork = new equinix.metal.DeviceNetworkType("deviceNetwork", {
    deviceId: deviceId,
    type: networkType,
});
export const deviceNetworkId = deviceNetwork.id;
Copy
import pulumi
import pulumi_equinix as equinix

config = pulumi.Config()
device_id = config.require("deviceId")
network_type = config.get("networkType")
if network_type is None:
    network_type = "hybrid"
device_network = equinix.metal.DeviceNetworkType("deviceNetwork",
    device_id=device_id,
    type=network_type)
pulumi.export("deviceNetworkId", device_network.id)
Copy
config:
  deviceId:
    type: string
  networkType:
    type: string
    default: hybrid
resources:
  deviceNetwork:
    type: equinix:metal:DeviceNetworkType
    properties:
      deviceId: ${deviceId}
      type: ${networkType}
outputs:
  deviceNetworkId: ${deviceNetwork.id}
Copy

Create DeviceNetworkType Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new DeviceNetworkType(name: string, args: DeviceNetworkTypeArgs, opts?: CustomResourceOptions);
@overload
def DeviceNetworkType(resource_name: str,
                      args: DeviceNetworkTypeArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def DeviceNetworkType(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      device_id: Optional[str] = None,
                      type: Optional[str] = None)
func NewDeviceNetworkType(ctx *Context, name string, args DeviceNetworkTypeArgs, opts ...ResourceOption) (*DeviceNetworkType, error)
public DeviceNetworkType(string name, DeviceNetworkTypeArgs args, CustomResourceOptions? opts = null)
public DeviceNetworkType(String name, DeviceNetworkTypeArgs args)
public DeviceNetworkType(String name, DeviceNetworkTypeArgs args, CustomResourceOptions options)
type: equinix:metal:DeviceNetworkType
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DeviceNetworkTypeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DeviceNetworkTypeArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DeviceNetworkTypeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DeviceNetworkTypeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DeviceNetworkTypeArgs
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 deviceNetworkTypeResource = new Equinix.Metal.DeviceNetworkType("deviceNetworkTypeResource", new()
{
    DeviceId = "string",
    Type = "string",
});
Copy
example, err := metal.NewDeviceNetworkType(ctx, "deviceNetworkTypeResource", &metal.DeviceNetworkTypeArgs{
	DeviceId: pulumi.String("string"),
	Type:     pulumi.String("string"),
})
Copy
var deviceNetworkTypeResource = new DeviceNetworkType("deviceNetworkTypeResource", DeviceNetworkTypeArgs.builder()
    .deviceId("string")
    .type("string")
    .build());
Copy
device_network_type_resource = equinix.metal.DeviceNetworkType("deviceNetworkTypeResource",
    device_id="string",
    type="string")
Copy
const deviceNetworkTypeResource = new equinix.metal.DeviceNetworkType("deviceNetworkTypeResource", {
    deviceId: "string",
    type: "string",
});
Copy
type: equinix:metal:DeviceNetworkType
properties:
    deviceId: string
    type: string
Copy

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

DeviceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the device on which the network type should be set.
Type This property is required. string
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
DeviceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the device on which the network type should be set.
Type This property is required. string
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
deviceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the device on which the network type should be set.
type This property is required. String
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
deviceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the device on which the network type should be set.
type This property is required. string
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
device_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the device on which the network type should be set.
type This property is required. str
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
deviceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the device on which the network type should be set.
type This property is required. String
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.

Outputs

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

Get an existing DeviceNetworkType 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?: DeviceNetworkTypeState, opts?: CustomResourceOptions): DeviceNetworkType
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        device_id: Optional[str] = None,
        type: Optional[str] = None) -> DeviceNetworkType
func GetDeviceNetworkType(ctx *Context, name string, id IDInput, state *DeviceNetworkTypeState, opts ...ResourceOption) (*DeviceNetworkType, error)
public static DeviceNetworkType Get(string name, Input<string> id, DeviceNetworkTypeState? state, CustomResourceOptions? opts = null)
public static DeviceNetworkType get(String name, Output<String> id, DeviceNetworkTypeState state, CustomResourceOptions options)
resources:  _:    type: equinix:metal:DeviceNetworkType    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DeviceId Changes to this property will trigger replacement. string
The ID of the device on which the network type should be set.
Type string
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
DeviceId Changes to this property will trigger replacement. string
The ID of the device on which the network type should be set.
Type string
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
deviceId Changes to this property will trigger replacement. String
The ID of the device on which the network type should be set.
type String
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
deviceId Changes to this property will trigger replacement. string
The ID of the device on which the network type should be set.
type string
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
device_id Changes to this property will trigger replacement. str
The ID of the device on which the network type should be set.
type str
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.
deviceId Changes to this property will trigger replacement. String
The ID of the device on which the network type should be set.
type String
Network type to set. Must be one of layer3, hybrid, hybrid-bonded, layer2-individual and layer2-bonded.

Package Details

Repository
equinix equinix/pulumi-equinix
License
Apache-2.0
Notes
This Pulumi package is based on the equinix Terraform Provider.