1. Packages
  2. Nsxt Provider
  3. API Docs
  4. LogicalPort
nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware

nsxt.LogicalPort

Explore with Pulumi AI

nsxt logo
nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware

    Create LogicalPort Resource

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

    Constructor syntax

    new LogicalPort(name: string, args: LogicalPortArgs, opts?: CustomResourceOptions);
    @overload
    def LogicalPort(resource_name: str,
                    args: LogicalPortArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def LogicalPort(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    logical_switch_id: Optional[str] = None,
                    admin_state: Optional[str] = None,
                    description: Optional[str] = None,
                    display_name: Optional[str] = None,
                    logical_port_id: Optional[str] = None,
                    switching_profile_ids: Optional[Sequence[LogicalPortSwitchingProfileIdArgs]] = None,
                    tags: Optional[Sequence[LogicalPortTagArgs]] = None)
    func NewLogicalPort(ctx *Context, name string, args LogicalPortArgs, opts ...ResourceOption) (*LogicalPort, error)
    public LogicalPort(string name, LogicalPortArgs args, CustomResourceOptions? opts = null)
    public LogicalPort(String name, LogicalPortArgs args)
    public LogicalPort(String name, LogicalPortArgs args, CustomResourceOptions options)
    
    type: nsxt:LogicalPort
    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 LogicalPortArgs
    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 LogicalPortArgs
    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 LogicalPortArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogicalPortArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogicalPortArgs
    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 logicalPortResource = new Nsxt.LogicalPort("logicalPortResource", new()
    {
        LogicalSwitchId = "string",
        AdminState = "string",
        Description = "string",
        DisplayName = "string",
        LogicalPortId = "string",
        SwitchingProfileIds = new[]
        {
            new Nsxt.Inputs.LogicalPortSwitchingProfileIdArgs
            {
                Key = "string",
                Value = "string",
            },
        },
        Tags = new[]
        {
            new Nsxt.Inputs.LogicalPortTagArgs
            {
                Scope = "string",
                Tag = "string",
            },
        },
    });
    
    example, err := nsxt.NewLogicalPort(ctx, "logicalPortResource", &nsxt.LogicalPortArgs{
    	LogicalSwitchId: pulumi.String("string"),
    	AdminState:      pulumi.String("string"),
    	Description:     pulumi.String("string"),
    	DisplayName:     pulumi.String("string"),
    	LogicalPortId:   pulumi.String("string"),
    	SwitchingProfileIds: nsxt.LogicalPortSwitchingProfileIdArray{
    		&nsxt.LogicalPortSwitchingProfileIdArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	Tags: nsxt.LogicalPortTagArray{
    		&nsxt.LogicalPortTagArgs{
    			Scope: pulumi.String("string"),
    			Tag:   pulumi.String("string"),
    		},
    	},
    })
    
    var logicalPortResource = new LogicalPort("logicalPortResource", LogicalPortArgs.builder()
        .logicalSwitchId("string")
        .adminState("string")
        .description("string")
        .displayName("string")
        .logicalPortId("string")
        .switchingProfileIds(LogicalPortSwitchingProfileIdArgs.builder()
            .key("string")
            .value("string")
            .build())
        .tags(LogicalPortTagArgs.builder()
            .scope("string")
            .tag("string")
            .build())
        .build());
    
    logical_port_resource = nsxt.LogicalPort("logicalPortResource",
        logical_switch_id="string",
        admin_state="string",
        description="string",
        display_name="string",
        logical_port_id="string",
        switching_profile_ids=[{
            "key": "string",
            "value": "string",
        }],
        tags=[{
            "scope": "string",
            "tag": "string",
        }])
    
    const logicalPortResource = new nsxt.LogicalPort("logicalPortResource", {
        logicalSwitchId: "string",
        adminState: "string",
        description: "string",
        displayName: "string",
        logicalPortId: "string",
        switchingProfileIds: [{
            key: "string",
            value: "string",
        }],
        tags: [{
            scope: "string",
            tag: "string",
        }],
    });
    
    type: nsxt:LogicalPort
    properties:
        adminState: string
        description: string
        displayName: string
        logicalPortId: string
        logicalSwitchId: string
        switchingProfileIds:
            - key: string
              value: string
        tags:
            - scope: string
              tag: string
    

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

    LogicalSwitchId string
    Logical switch ID for the logical port.
    AdminState string
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    Description string
    Description of this resource.
    DisplayName string
    Display name, defaults to ID if not set.
    LogicalPortId string
    ID of the logical port.
    SwitchingProfileIds List<LogicalPortSwitchingProfileId>
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    Tags List<LogicalPortTag>
    A list of scope + tag pairs to associate with this logical port.
    LogicalSwitchId string
    Logical switch ID for the logical port.
    AdminState string
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    Description string
    Description of this resource.
    DisplayName string
    Display name, defaults to ID if not set.
    LogicalPortId string
    ID of the logical port.
    SwitchingProfileIds []LogicalPortSwitchingProfileIdArgs
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    Tags []LogicalPortTagArgs
    A list of scope + tag pairs to associate with this logical port.
    logicalSwitchId String
    Logical switch ID for the logical port.
    adminState String
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    description String
    Description of this resource.
    displayName String
    Display name, defaults to ID if not set.
    logicalPortId String
    ID of the logical port.
    switchingProfileIds List<LogicalPortSwitchingProfileId>
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    tags List<LogicalPortTag>
    A list of scope + tag pairs to associate with this logical port.
    logicalSwitchId string
    Logical switch ID for the logical port.
    adminState string
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    description string
    Description of this resource.
    displayName string
    Display name, defaults to ID if not set.
    logicalPortId string
    ID of the logical port.
    switchingProfileIds LogicalPortSwitchingProfileId[]
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    tags LogicalPortTag[]
    A list of scope + tag pairs to associate with this logical port.
    logical_switch_id str
    Logical switch ID for the logical port.
    admin_state str
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    description str
    Description of this resource.
    display_name str
    Display name, defaults to ID if not set.
    logical_port_id str
    ID of the logical port.
    switching_profile_ids Sequence[LogicalPortSwitchingProfileIdArgs]
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    tags Sequence[LogicalPortTagArgs]
    A list of scope + tag pairs to associate with this logical port.
    logicalSwitchId String
    Logical switch ID for the logical port.
    adminState String
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    description String
    Description of this resource.
    displayName String
    Display name, defaults to ID if not set.
    logicalPortId String
    ID of the logical port.
    switchingProfileIds List<Property Map>
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    tags List<Property Map>
    A list of scope + tag pairs to associate with this logical port.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Revision double
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    Id string
    The provider-assigned unique ID for this managed resource.
    Revision float64
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    id String
    The provider-assigned unique ID for this managed resource.
    revision Double
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    id string
    The provider-assigned unique ID for this managed resource.
    revision number
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    id str
    The provider-assigned unique ID for this managed resource.
    revision float
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    id String
    The provider-assigned unique ID for this managed resource.
    revision Number
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.

    Look up Existing LogicalPort Resource

    Get an existing LogicalPort 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?: LogicalPortState, opts?: CustomResourceOptions): LogicalPort
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            admin_state: Optional[str] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            logical_port_id: Optional[str] = None,
            logical_switch_id: Optional[str] = None,
            revision: Optional[float] = None,
            switching_profile_ids: Optional[Sequence[LogicalPortSwitchingProfileIdArgs]] = None,
            tags: Optional[Sequence[LogicalPortTagArgs]] = None) -> LogicalPort
    func GetLogicalPort(ctx *Context, name string, id IDInput, state *LogicalPortState, opts ...ResourceOption) (*LogicalPort, error)
    public static LogicalPort Get(string name, Input<string> id, LogicalPortState? state, CustomResourceOptions? opts = null)
    public static LogicalPort get(String name, Output<String> id, LogicalPortState state, CustomResourceOptions options)
    resources:  _:    type: nsxt:LogicalPort    get:      id: ${id}
    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:
    AdminState string
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    Description string
    Description of this resource.
    DisplayName string
    Display name, defaults to ID if not set.
    LogicalPortId string
    ID of the logical port.
    LogicalSwitchId string
    Logical switch ID for the logical port.
    Revision double
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    SwitchingProfileIds List<LogicalPortSwitchingProfileId>
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    Tags List<LogicalPortTag>
    A list of scope + tag pairs to associate with this logical port.
    AdminState string
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    Description string
    Description of this resource.
    DisplayName string
    Display name, defaults to ID if not set.
    LogicalPortId string
    ID of the logical port.
    LogicalSwitchId string
    Logical switch ID for the logical port.
    Revision float64
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    SwitchingProfileIds []LogicalPortSwitchingProfileIdArgs
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    Tags []LogicalPortTagArgs
    A list of scope + tag pairs to associate with this logical port.
    adminState String
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    description String
    Description of this resource.
    displayName String
    Display name, defaults to ID if not set.
    logicalPortId String
    ID of the logical port.
    logicalSwitchId String
    Logical switch ID for the logical port.
    revision Double
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    switchingProfileIds List<LogicalPortSwitchingProfileId>
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    tags List<LogicalPortTag>
    A list of scope + tag pairs to associate with this logical port.
    adminState string
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    description string
    Description of this resource.
    displayName string
    Display name, defaults to ID if not set.
    logicalPortId string
    ID of the logical port.
    logicalSwitchId string
    Logical switch ID for the logical port.
    revision number
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    switchingProfileIds LogicalPortSwitchingProfileId[]
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    tags LogicalPortTag[]
    A list of scope + tag pairs to associate with this logical port.
    admin_state str
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    description str
    Description of this resource.
    display_name str
    Display name, defaults to ID if not set.
    logical_port_id str
    ID of the logical port.
    logical_switch_id str
    Logical switch ID for the logical port.
    revision float
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    switching_profile_ids Sequence[LogicalPortSwitchingProfileIdArgs]
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    tags Sequence[LogicalPortTagArgs]
    A list of scope + tag pairs to associate with this logical port.
    adminState String
    Admin state for the logical port. Accepted values - 'UP' or 'DOWN'. The default value is 'UP'.
    description String
    Description of this resource.
    displayName String
    Display name, defaults to ID if not set.
    logicalPortId String
    ID of the logical port.
    logicalSwitchId String
    Logical switch ID for the logical port.
    revision Number
    Indicates current revision number of the object as seen by NSX-T API server. This attribute can be useful for debugging.
    switchingProfileIds List<Property Map>
    List of IDs of switching profiles (of various types) to be associated with this switch. Default switching profiles will be used if not specified.
    tags List<Property Map>
    A list of scope + tag pairs to associate with this logical port.

    Supporting Types

    LogicalPortSwitchingProfileId, LogicalPortSwitchingProfileIdArgs

    Key string
    The resource type of this profile
    Value string
    The ID of this profile
    Key string
    The resource type of this profile
    Value string
    The ID of this profile
    key String
    The resource type of this profile
    value String
    The ID of this profile
    key string
    The resource type of this profile
    value string
    The ID of this profile
    key str
    The resource type of this profile
    value str
    The ID of this profile
    key String
    The resource type of this profile
    value String
    The ID of this profile

    LogicalPortTag, LogicalPortTagArgs

    Scope string
    Tag string
    A list of scope + tag pairs to associate with this logical port.
    Scope string
    Tag string
    A list of scope + tag pairs to associate with this logical port.
    scope String
    tag String
    A list of scope + tag pairs to associate with this logical port.
    scope string
    tag string
    A list of scope + tag pairs to associate with this logical port.
    scope str
    tag str
    A list of scope + tag pairs to associate with this logical port.
    scope String
    tag String
    A list of scope + tag pairs to associate with this logical port.

    Package Details

    Repository
    nsxt vmware/terraform-provider-nsxt
    License
    Notes
    This Pulumi package is based on the nsxt Terraform Provider.
    nsxt logo
    nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware