Equinix v0.18.0 published on Monday, Sep 23, 2024 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,
};
});
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
})
}
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());
}
}
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)
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;
config:
deviceId:
type: string
networkType:
type: string
default: hybrid
resources:
deviceNetwork:
type: equinix:metal:DeviceNetworkType
properties:
deviceId: ${deviceId}
type: ${networkType}
outputs:
deviceNetworkId: ${deviceNetwork.id}
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 string
- The unique name of the resource.
- args DeviceNetworkTypeArgs
- 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 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 string
- The unique name of the resource.
- args DeviceNetworkTypeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeviceNetworkTypeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
example, err := metal.NewDeviceNetworkType(ctx, "deviceNetworkTypeResource", &metal.DeviceNetworkTypeArgs{
DeviceId: pulumi.String("string"),
Type: pulumi.String("string"),
})
var deviceNetworkTypeResource = new DeviceNetworkType("deviceNetworkTypeResource", DeviceNetworkTypeArgs.builder()
.deviceId("string")
.type("string")
.build());
device_network_type_resource = equinix.metal.DeviceNetworkType("deviceNetworkTypeResource",
device_id="string",
type="string")
const deviceNetworkTypeResource = new equinix.metal.DeviceNetworkType("deviceNetworkTypeResource", {
deviceId: "string",
type: "string",
});
type: equinix:metal:DeviceNetworkType
properties:
deviceId: string
type: string
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
The DeviceNetworkType resource accepts the following input properties:
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)
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.
Package Details
- Repository
- equinix equinix/pulumi-equinix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
equinix
Terraform Provider.