1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. Port
Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix

equinix.metal.Port

Explore with Pulumi AI

equinix logo
Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Equinix = Pulumi.Equinix;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var portId = config.Require("portId");
        var org = new Equinix.Metal.Port("org", new()
        {
            PortId = portId,
            Bonded = true,
            Layer2 = true,
        });
    
        return new Dictionary<string, object?>
        {
            ["portType"] = port.Type,
            ["portBondedNetworkType"] = port.NetworkType,
        };
    });
    
    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, "")
    		portId := cfg.Require("portId")
    		_, err := metal.NewPort(ctx, "org", &metal.PortArgs{
    			PortId: pulumi.String(portId),
    			Bonded: pulumi.Bool(true),
    			Layer2: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("portType", port.Type)
    		ctx.Export("portBondedNetworkType", port.NetworkType)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.equinix.pulumi.metal.Port;
    import com.equinix.pulumi.metal.PortArgs;
    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 portId = config.get("portId").get();
            final var vlanId = config.get("vlanId").get();
            var port = new Port("port", PortArgs.builder()        
                .portId(portId)
                .bonded(true)
                .layer2(false)
                .vlanIds(vlanId)
                .build());
    
            ctx.export("portType", port.type());
            ctx.export("portBondedNetworkType", port.networkType());
        }
    }
    
    import pulumi
    import pulumi_equinix as equinix
    
    config = pulumi.Config()
    port_id = config.require("portId")
    org = equinix.metal.Port("org",
        port_id=port_id,
        bonded=True,
        layer2=True)
    pulumi.export("portType", port["type"])
    pulumi.export("portBondedNetworkType", port["networkType"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as equinix from "@equinix-labs/pulumi-equinix";
    
    const config = new pulumi.Config();
    const portId = config.require("portId");
    const org = new equinix.metal.Port("org", {
        portId: portId,
        bonded: true,
        layer2: true,
    });
    export const portType = port.type;
    export const portBondedNetworkType = port.networkType;
    
    config:
      portId:
        type: string
    resources:
      org:
        type: equinix:metal:Port
        properties:
          portId: ${portId}
          bonded: true
          layer2: true
    outputs:
      portType: ${port.type}
      portBondedNetworkType: ${port.networkType}
    

    Create Port Resource

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

    Constructor syntax

    new Port(name: string, args: PortArgs, opts?: CustomResourceOptions);
    @overload
    def Port(resource_name: str,
             args: PortArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Port(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             bonded: Optional[bool] = None,
             port_id: Optional[str] = None,
             layer2: Optional[bool] = None,
             native_vlan_id: Optional[str] = None,
             reset_on_delete: Optional[bool] = None,
             vlan_ids: Optional[Sequence[str]] = None,
             vxlan_ids: Optional[Sequence[int]] = None)
    func NewPort(ctx *Context, name string, args PortArgs, opts ...ResourceOption) (*Port, error)
    public Port(string name, PortArgs args, CustomResourceOptions? opts = null)
    public Port(String name, PortArgs args)
    public Port(String name, PortArgs args, CustomResourceOptions options)
    
    type: equinix:metal:Port
    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 PortArgs
    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 PortArgs
    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 PortArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PortArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PortArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var portResource = new Equinix.Metal.Port("portResource", new()
    {
        Bonded = false,
        PortId = "string",
        Layer2 = false,
        NativeVlanId = "string",
        ResetOnDelete = false,
        VlanIds = new[]
        {
            "string",
        },
        VxlanIds = new[]
        {
            0,
        },
    });
    
    example, err := metal.NewPort(ctx, "portResource", &metal.PortArgs{
    	Bonded:        pulumi.Bool(false),
    	PortId:        pulumi.String("string"),
    	Layer2:        pulumi.Bool(false),
    	NativeVlanId:  pulumi.String("string"),
    	ResetOnDelete: pulumi.Bool(false),
    	VlanIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	VxlanIds: pulumi.IntArray{
    		pulumi.Int(0),
    	},
    })
    
    var portResource = new Port("portResource", PortArgs.builder()        
        .bonded(false)
        .portId("string")
        .layer2(false)
        .nativeVlanId("string")
        .resetOnDelete(false)
        .vlanIds("string")
        .vxlanIds(0)
        .build());
    
    port_resource = equinix.metal.Port("portResource",
        bonded=False,
        port_id="string",
        layer2=False,
        native_vlan_id="string",
        reset_on_delete=False,
        vlan_ids=["string"],
        vxlan_ids=[0])
    
    const portResource = new equinix.metal.Port("portResource", {
        bonded: false,
        portId: "string",
        layer2: false,
        nativeVlanId: "string",
        resetOnDelete: false,
        vlanIds: ["string"],
        vxlanIds: [0],
    });
    
    type: equinix:metal:Port
    properties:
        bonded: false
        layer2: false
        nativeVlanId: string
        portId: string
        resetOnDelete: false
        vlanIds:
            - string
        vxlanIds:
            - 0
    

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

    Bonded bool
    Whether the port should be bonded.
    PortId string
    ID of the port to read.
    Layer2 bool
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    NativeVlanId string
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    ResetOnDelete bool
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    VlanIds List<string>
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    VxlanIds List<int>
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    Bonded bool
    Whether the port should be bonded.
    PortId string
    ID of the port to read.
    Layer2 bool
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    NativeVlanId string
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    ResetOnDelete bool
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    VlanIds []string
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    VxlanIds []int
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    bonded Boolean
    Whether the port should be bonded.
    portId String
    ID of the port to read.
    layer2 Boolean
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    nativeVlanId String
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    resetOnDelete Boolean
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    vlanIds List<String>
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    vxlanIds List<Integer>
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    bonded boolean
    Whether the port should be bonded.
    portId string
    ID of the port to read.
    layer2 boolean
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    nativeVlanId string
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    resetOnDelete boolean
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    vlanIds string[]
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    vxlanIds number[]
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    bonded bool
    Whether the port should be bonded.
    port_id str
    ID of the port to read.
    layer2 bool
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    native_vlan_id str
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    reset_on_delete bool
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    vlan_ids Sequence[str]
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    vxlan_ids Sequence[int]
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    bonded Boolean
    Whether the port should be bonded.
    portId String
    ID of the port to read.
    layer2 Boolean
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    nativeVlanId String
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    resetOnDelete Boolean
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    vlanIds List<String>
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    vxlanIds List<Number>
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Port resource produces the following output properties:

    BondId string
    UUID of the bond port.
    BondName string
    Name of the bond port.
    DisbondSupported bool
    Flag indicating whether the port can be removed from a bond.
    Id string
    The provider-assigned unique ID for this managed resource.
    Mac string
    MAC address of the port.
    Name string
    Name of the port, e.g. bond0 or eth0.
    NetworkType string
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    Type string
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    BondId string
    UUID of the bond port.
    BondName string
    Name of the bond port.
    DisbondSupported bool
    Flag indicating whether the port can be removed from a bond.
    Id string
    The provider-assigned unique ID for this managed resource.
    Mac string
    MAC address of the port.
    Name string
    Name of the port, e.g. bond0 or eth0.
    NetworkType string
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    Type string
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    bondId String
    UUID of the bond port.
    bondName String
    Name of the bond port.
    disbondSupported Boolean
    Flag indicating whether the port can be removed from a bond.
    id String
    The provider-assigned unique ID for this managed resource.
    mac String
    MAC address of the port.
    name String
    Name of the port, e.g. bond0 or eth0.
    networkType String
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    type String
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    bondId string
    UUID of the bond port.
    bondName string
    Name of the bond port.
    disbondSupported boolean
    Flag indicating whether the port can be removed from a bond.
    id string
    The provider-assigned unique ID for this managed resource.
    mac string
    MAC address of the port.
    name string
    Name of the port, e.g. bond0 or eth0.
    networkType string
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    type string
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    bond_id str
    UUID of the bond port.
    bond_name str
    Name of the bond port.
    disbond_supported bool
    Flag indicating whether the port can be removed from a bond.
    id str
    The provider-assigned unique ID for this managed resource.
    mac str
    MAC address of the port.
    name str
    Name of the port, e.g. bond0 or eth0.
    network_type str
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    type str
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    bondId String
    UUID of the bond port.
    bondName String
    Name of the bond port.
    disbondSupported Boolean
    Flag indicating whether the port can be removed from a bond.
    id String
    The provider-assigned unique ID for this managed resource.
    mac String
    MAC address of the port.
    name String
    Name of the port, e.g. bond0 or eth0.
    networkType String
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    type String
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.

    Look up Existing Port Resource

    Get an existing Port 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?: PortState, opts?: CustomResourceOptions): Port
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bond_id: Optional[str] = None,
            bond_name: Optional[str] = None,
            bonded: Optional[bool] = None,
            disbond_supported: Optional[bool] = None,
            layer2: Optional[bool] = None,
            mac: Optional[str] = None,
            name: Optional[str] = None,
            native_vlan_id: Optional[str] = None,
            network_type: Optional[str] = None,
            port_id: Optional[str] = None,
            reset_on_delete: Optional[bool] = None,
            type: Optional[str] = None,
            vlan_ids: Optional[Sequence[str]] = None,
            vxlan_ids: Optional[Sequence[int]] = None) -> Port
    func GetPort(ctx *Context, name string, id IDInput, state *PortState, opts ...ResourceOption) (*Port, error)
    public static Port Get(string name, Input<string> id, PortState? state, CustomResourceOptions? opts = null)
    public static Port get(String name, Output<String> id, PortState 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.
    The following state arguments are supported:
    BondId string
    UUID of the bond port.
    BondName string
    Name of the bond port.
    Bonded bool
    Whether the port should be bonded.
    DisbondSupported bool
    Flag indicating whether the port can be removed from a bond.
    Layer2 bool
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    Mac string
    MAC address of the port.
    Name string
    Name of the port, e.g. bond0 or eth0.
    NativeVlanId string
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    NetworkType string
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    PortId string
    ID of the port to read.
    ResetOnDelete bool
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    Type string
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    VlanIds List<string>
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    VxlanIds List<int>
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    BondId string
    UUID of the bond port.
    BondName string
    Name of the bond port.
    Bonded bool
    Whether the port should be bonded.
    DisbondSupported bool
    Flag indicating whether the port can be removed from a bond.
    Layer2 bool
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    Mac string
    MAC address of the port.
    Name string
    Name of the port, e.g. bond0 or eth0.
    NativeVlanId string
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    NetworkType string
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    PortId string
    ID of the port to read.
    ResetOnDelete bool
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    Type string
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    VlanIds []string
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    VxlanIds []int
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    bondId String
    UUID of the bond port.
    bondName String
    Name of the bond port.
    bonded Boolean
    Whether the port should be bonded.
    disbondSupported Boolean
    Flag indicating whether the port can be removed from a bond.
    layer2 Boolean
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    mac String
    MAC address of the port.
    name String
    Name of the port, e.g. bond0 or eth0.
    nativeVlanId String
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    networkType String
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    portId String
    ID of the port to read.
    resetOnDelete Boolean
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    type String
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    vlanIds List<String>
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    vxlanIds List<Integer>
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    bondId string
    UUID of the bond port.
    bondName string
    Name of the bond port.
    bonded boolean
    Whether the port should be bonded.
    disbondSupported boolean
    Flag indicating whether the port can be removed from a bond.
    layer2 boolean
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    mac string
    MAC address of the port.
    name string
    Name of the port, e.g. bond0 or eth0.
    nativeVlanId string
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    networkType string
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    portId string
    ID of the port to read.
    resetOnDelete boolean
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    type string
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    vlanIds string[]
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    vxlanIds number[]
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    bond_id str
    UUID of the bond port.
    bond_name str
    Name of the bond port.
    bonded bool
    Whether the port should be bonded.
    disbond_supported bool
    Flag indicating whether the port can be removed from a bond.
    layer2 bool
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    mac str
    MAC address of the port.
    name str
    Name of the port, e.g. bond0 or eth0.
    native_vlan_id str
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    network_type str
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    port_id str
    ID of the port to read.
    reset_on_delete bool
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    type str
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    vlan_ids Sequence[str]
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    vxlan_ids Sequence[int]
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.
    bondId String
    UUID of the bond port.
    bondName String
    Name of the bond port.
    bonded Boolean
    Whether the port should be bonded.
    disbondSupported Boolean
    Flag indicating whether the port can be removed from a bond.
    layer2 Boolean
    Whether to put the port to Layer 2 mode, valid only for bond ports.
    mac String
    MAC address of the port.
    name String
    Name of the port, e.g. bond0 or eth0.
    nativeVlanId String
    UUID of a VLAN to assign as a native VLAN. It must be one of attached VLANs (from vlan_ids parameter).
    networkType String
    One of layer2-bonded, layer2-individual, layer3, hybrid and hybrid-bonded. This attribute is only set on bond ports.
    portId String
    ID of the port to read.
    resetOnDelete Boolean
    Behavioral setting to reset the port to default settings (layer3 bonded mode without any vlan attached) before delete/destroy.
    type String
    Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports.
    vlanIds List<String>
    List of VLAN UUIDs to attach to the port, valid only for L2 and Hybrid ports.
    vxlanIds List<Number>
    List of VXLAN IDs to attach to the port, valid only for L2 and Hybrid ports.

    Package Details

    Repository
    equinix equinix/pulumi-equinix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the equinix Terraform Provider.
    equinix logo
    Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix