1. Registry
  2. Packages
  3. Megaport Provider
  4. API Docs
  5. getPorts
Viewing docs for megaport 1.19.1
published on Monday, Sep 28, 2026 by megaport
Viewing docs for megaport 1.19.1
published on Monday, Sep 28, 2026 by megaport

    Looks up ports in the Megaport API. Optionally filter by product_uid to retrieve a specific port.

    Using getPorts

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getPorts(args: GetPortsArgs, opts?: InvokeOptions): Promise<GetPortsResult>
    function getPortsOutput(args: GetPortsOutputArgs, opts?: InvokeOutputOptions): Output<GetPortsResult>
    def get_ports(include_resource_tags: Optional[bool] = None,
                  product_uid: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetPortsResult
    def get_ports_output(include_resource_tags: pulumi.Input[Optional[bool]] = None,
                  product_uid: pulumi.Input[Optional[str]] = None,
                  opts: Optional[InvokeOutputOptions] = None) -> Output[GetPortsResult]
    func GetPorts(ctx *Context, args *GetPortsArgs, opts ...InvokeOption) (*GetPortsResult, error)
    func GetPortsOutput(ctx *Context, args *GetPortsOutputArgs, opts ...InvokeOption) GetPortsResultOutput

    > Note: This function is named GetPorts in the Go SDK.

    public static class GetPorts 
    {
        public static Task<GetPortsResult> InvokeAsync(GetPortsArgs args, InvokeOptions? opts = null)
        public static Output<GetPortsResult> Invoke(GetPortsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetPortsResult> Invoke(GetPortsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetPortsResult> getPorts(GetPortsArgs args, InvokeOptions options)
    public static Output<GetPortsResult> getPorts(GetPortsArgs args, InvokeOptions options)
    public static Output<GetPortsResult> getPorts(GetPortsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: megaport:index/getPorts:getPorts
      arguments:
        # arguments dictionary
    data "megaport_get_ports" "name" {
        # arguments
    }

    The following arguments are supported:

    IncludeResourceTags bool
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    ProductUid string
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    IncludeResourceTags bool
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    ProductUid string
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    include_resource_tags bool
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    product_uid string
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    includeResourceTags Boolean
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    productUid String
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    includeResourceTags boolean
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    productUid string
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    include_resource_tags bool
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    product_uid str
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    includeResourceTags Boolean
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    productUid String
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.

    getPorts Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ports List<GetPortsPort>
    List of ports with detailed information.
    IncludeResourceTags bool
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    ProductUid string
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ports []GetPortsPort
    List of ports with detailed information.
    IncludeResourceTags bool
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    ProductUid string
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    id string
    The provider-assigned unique ID for this managed resource.
    ports list(object)
    List of ports with detailed information.
    include_resource_tags bool
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    product_uid string
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    id String
    The provider-assigned unique ID for this managed resource.
    ports List<GetPortsPort>
    List of ports with detailed information.
    includeResourceTags Boolean
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    productUid String
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    id string
    The provider-assigned unique ID for this managed resource.
    ports GetPortsPort[]
    List of ports with detailed information.
    includeResourceTags boolean
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    productUid string
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    id str
    The provider-assigned unique ID for this managed resource.
    ports Sequence[GetPortsPort]
    List of ports with detailed information.
    include_resource_tags bool
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    product_uid str
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.
    id String
    The provider-assigned unique ID for this managed resource.
    ports List<Property Map>
    List of ports with detailed information.
    includeResourceTags Boolean
    Whether to fetch resource tags for each port. Enabling this causes an additional API call per port, which may be slow for accounts with many ports.
    productUid String
    The unique identifier of a specific port to look up. If not provided, all active ports are returned.

    Supporting Types

    GetPortsPort

    AdminLocked bool
    Whether the port is admin locked.
    AggregationId double
    Numeric ID of the LAG aggregation this port belongs to. Zero if the port is not part of a LAG.
    Cancelable bool
    Whether the port can be cancelled.
    CompanyName string
    The name of the company that owns the port.
    CompanyUid string
    The Megaport Company UID of the port owner.
    ContractEndDate string
    The contract end date of the port.
    ContractStartDate string
    The contract start date of the port.
    ContractTermMonths double
    The contract term of the port in months.
    CostCentre string
    The cost centre of the port for billing purposes.
    CreateDate string
    The date the port was created.
    CreatedBy string
    The user who created the port.
    DiversityZone string
    The diversity zone of the port.
    LagCount double
    The number of ports in the LAG. Zero if the port is not part of a LAG.
    LagId double
    Numeric ID of the LAG this port belongs to. Zero if the port is not part of a LAG.
    LagPortUids List<string>
    The unique identifiers of the ports in the LAG. Null if the port is not part of a LAG.
    LagPrimary bool
    Whether the port is a LAG primary.
    LiveDate string
    The date the port went live.
    LocationId double
    The numeric location ID of the port.
    Locked bool
    Whether the port is locked.
    Market string
    The market the port is in.
    MarketplaceVisibility bool
    Whether the port is visible in the Marketplace.
    PortSpeed double
    The bandwidth speed of the port in Mbps.
    ProductName string
    The name of the port.
    ProductUid string
    The unique identifier of the port.
    ProvisioningStatus string
    The provisioning status of the port.
    ResourceTags Dictionary<string, string>
    The resource tags associated with the port. Only populated when includeresourcetags is set to true; null otherwise (including when the port has no tags).
    SecondaryName string
    The secondary name of the port.
    TerminateDate string
    The date the port will be terminated.
    VxcAutoApproval bool
    Whether VXC connections are auto-approved on this port.
    VxcPermitted bool
    Whether VXC connections are permitted on this port.
    AdminLocked bool
    Whether the port is admin locked.
    AggregationId float64
    Numeric ID of the LAG aggregation this port belongs to. Zero if the port is not part of a LAG.
    Cancelable bool
    Whether the port can be cancelled.
    CompanyName string
    The name of the company that owns the port.
    CompanyUid string
    The Megaport Company UID of the port owner.
    ContractEndDate string
    The contract end date of the port.
    ContractStartDate string
    The contract start date of the port.
    ContractTermMonths float64
    The contract term of the port in months.
    CostCentre string
    The cost centre of the port for billing purposes.
    CreateDate string
    The date the port was created.
    CreatedBy string
    The user who created the port.
    DiversityZone string
    The diversity zone of the port.
    LagCount float64
    The number of ports in the LAG. Zero if the port is not part of a LAG.
    LagId float64
    Numeric ID of the LAG this port belongs to. Zero if the port is not part of a LAG.
    LagPortUids []string
    The unique identifiers of the ports in the LAG. Null if the port is not part of a LAG.
    LagPrimary bool
    Whether the port is a LAG primary.
    LiveDate string
    The date the port went live.
    LocationId float64
    The numeric location ID of the port.
    Locked bool
    Whether the port is locked.
    Market string
    The market the port is in.
    MarketplaceVisibility bool
    Whether the port is visible in the Marketplace.
    PortSpeed float64
    The bandwidth speed of the port in Mbps.
    ProductName string
    The name of the port.
    ProductUid string
    The unique identifier of the port.
    ProvisioningStatus string
    The provisioning status of the port.
    ResourceTags map[string]string
    The resource tags associated with the port. Only populated when includeresourcetags is set to true; null otherwise (including when the port has no tags).
    SecondaryName string
    The secondary name of the port.
    TerminateDate string
    The date the port will be terminated.
    VxcAutoApproval bool
    Whether VXC connections are auto-approved on this port.
    VxcPermitted bool
    Whether VXC connections are permitted on this port.
    admin_locked bool
    Whether the port is admin locked.
    aggregation_id number
    Numeric ID of the LAG aggregation this port belongs to. Zero if the port is not part of a LAG.
    cancelable bool
    Whether the port can be cancelled.
    company_name string
    The name of the company that owns the port.
    company_uid string
    The Megaport Company UID of the port owner.
    contract_end_date string
    The contract end date of the port.
    contract_start_date string
    The contract start date of the port.
    contract_term_months number
    The contract term of the port in months.
    cost_centre string
    The cost centre of the port for billing purposes.
    create_date string
    The date the port was created.
    created_by string
    The user who created the port.
    diversity_zone string
    The diversity zone of the port.
    lag_count number
    The number of ports in the LAG. Zero if the port is not part of a LAG.
    lag_id number
    Numeric ID of the LAG this port belongs to. Zero if the port is not part of a LAG.
    lag_port_uids list(string)
    The unique identifiers of the ports in the LAG. Null if the port is not part of a LAG.
    lag_primary bool
    Whether the port is a LAG primary.
    live_date string
    The date the port went live.
    location_id number
    The numeric location ID of the port.
    locked bool
    Whether the port is locked.
    market string
    The market the port is in.
    marketplace_visibility bool
    Whether the port is visible in the Marketplace.
    port_speed number
    The bandwidth speed of the port in Mbps.
    product_name string
    The name of the port.
    product_uid string
    The unique identifier of the port.
    provisioning_status string
    The provisioning status of the port.
    resource_tags map(string)
    The resource tags associated with the port. Only populated when includeresourcetags is set to true; null otherwise (including when the port has no tags).
    secondary_name string
    The secondary name of the port.
    terminate_date string
    The date the port will be terminated.
    vxc_auto_approval bool
    Whether VXC connections are auto-approved on this port.
    vxc_permitted bool
    Whether VXC connections are permitted on this port.
    adminLocked Boolean
    Whether the port is admin locked.
    aggregationId Double
    Numeric ID of the LAG aggregation this port belongs to. Zero if the port is not part of a LAG.
    cancelable Boolean
    Whether the port can be cancelled.
    companyName String
    The name of the company that owns the port.
    companyUid String
    The Megaport Company UID of the port owner.
    contractEndDate String
    The contract end date of the port.
    contractStartDate String
    The contract start date of the port.
    contractTermMonths Double
    The contract term of the port in months.
    costCentre String
    The cost centre of the port for billing purposes.
    createDate String
    The date the port was created.
    createdBy String
    The user who created the port.
    diversityZone String
    The diversity zone of the port.
    lagCount Double
    The number of ports in the LAG. Zero if the port is not part of a LAG.
    lagId Double
    Numeric ID of the LAG this port belongs to. Zero if the port is not part of a LAG.
    lagPortUids List<String>
    The unique identifiers of the ports in the LAG. Null if the port is not part of a LAG.
    lagPrimary Boolean
    Whether the port is a LAG primary.
    liveDate String
    The date the port went live.
    locationId Double
    The numeric location ID of the port.
    locked Boolean
    Whether the port is locked.
    market String
    The market the port is in.
    marketplaceVisibility Boolean
    Whether the port is visible in the Marketplace.
    portSpeed Double
    The bandwidth speed of the port in Mbps.
    productName String
    The name of the port.
    productUid String
    The unique identifier of the port.
    provisioningStatus String
    The provisioning status of the port.
    resourceTags Map<String,String>
    The resource tags associated with the port. Only populated when includeresourcetags is set to true; null otherwise (including when the port has no tags).
    secondaryName String
    The secondary name of the port.
    terminateDate String
    The date the port will be terminated.
    vxcAutoApproval Boolean
    Whether VXC connections are auto-approved on this port.
    vxcPermitted Boolean
    Whether VXC connections are permitted on this port.
    adminLocked boolean
    Whether the port is admin locked.
    aggregationId number
    Numeric ID of the LAG aggregation this port belongs to. Zero if the port is not part of a LAG.
    cancelable boolean
    Whether the port can be cancelled.
    companyName string
    The name of the company that owns the port.
    companyUid string
    The Megaport Company UID of the port owner.
    contractEndDate string
    The contract end date of the port.
    contractStartDate string
    The contract start date of the port.
    contractTermMonths number
    The contract term of the port in months.
    costCentre string
    The cost centre of the port for billing purposes.
    createDate string
    The date the port was created.
    createdBy string
    The user who created the port.
    diversityZone string
    The diversity zone of the port.
    lagCount number
    The number of ports in the LAG. Zero if the port is not part of a LAG.
    lagId number
    Numeric ID of the LAG this port belongs to. Zero if the port is not part of a LAG.
    lagPortUids string[]
    The unique identifiers of the ports in the LAG. Null if the port is not part of a LAG.
    lagPrimary boolean
    Whether the port is a LAG primary.
    liveDate string
    The date the port went live.
    locationId number
    The numeric location ID of the port.
    locked boolean
    Whether the port is locked.
    market string
    The market the port is in.
    marketplaceVisibility boolean
    Whether the port is visible in the Marketplace.
    portSpeed number
    The bandwidth speed of the port in Mbps.
    productName string
    The name of the port.
    productUid string
    The unique identifier of the port.
    provisioningStatus string
    The provisioning status of the port.
    resourceTags {[key: string]: string}
    The resource tags associated with the port. Only populated when includeresourcetags is set to true; null otherwise (including when the port has no tags).
    secondaryName string
    The secondary name of the port.
    terminateDate string
    The date the port will be terminated.
    vxcAutoApproval boolean
    Whether VXC connections are auto-approved on this port.
    vxcPermitted boolean
    Whether VXC connections are permitted on this port.
    admin_locked bool
    Whether the port is admin locked.
    aggregation_id float
    Numeric ID of the LAG aggregation this port belongs to. Zero if the port is not part of a LAG.
    cancelable bool
    Whether the port can be cancelled.
    company_name str
    The name of the company that owns the port.
    company_uid str
    The Megaport Company UID of the port owner.
    contract_end_date str
    The contract end date of the port.
    contract_start_date str
    The contract start date of the port.
    contract_term_months float
    The contract term of the port in months.
    cost_centre str
    The cost centre of the port for billing purposes.
    create_date str
    The date the port was created.
    created_by str
    The user who created the port.
    diversity_zone str
    The diversity zone of the port.
    lag_count float
    The number of ports in the LAG. Zero if the port is not part of a LAG.
    lag_id float
    Numeric ID of the LAG this port belongs to. Zero if the port is not part of a LAG.
    lag_port_uids Sequence[str]
    The unique identifiers of the ports in the LAG. Null if the port is not part of a LAG.
    lag_primary bool
    Whether the port is a LAG primary.
    live_date str
    The date the port went live.
    location_id float
    The numeric location ID of the port.
    locked bool
    Whether the port is locked.
    market str
    The market the port is in.
    marketplace_visibility bool
    Whether the port is visible in the Marketplace.
    port_speed float
    The bandwidth speed of the port in Mbps.
    product_name str
    The name of the port.
    product_uid str
    The unique identifier of the port.
    provisioning_status str
    The provisioning status of the port.
    resource_tags Mapping[str, str]
    The resource tags associated with the port. Only populated when includeresourcetags is set to true; null otherwise (including when the port has no tags).
    secondary_name str
    The secondary name of the port.
    terminate_date str
    The date the port will be terminated.
    vxc_auto_approval bool
    Whether VXC connections are auto-approved on this port.
    vxc_permitted bool
    Whether VXC connections are permitted on this port.
    adminLocked Boolean
    Whether the port is admin locked.
    aggregationId Number
    Numeric ID of the LAG aggregation this port belongs to. Zero if the port is not part of a LAG.
    cancelable Boolean
    Whether the port can be cancelled.
    companyName String
    The name of the company that owns the port.
    companyUid String
    The Megaport Company UID of the port owner.
    contractEndDate String
    The contract end date of the port.
    contractStartDate String
    The contract start date of the port.
    contractTermMonths Number
    The contract term of the port in months.
    costCentre String
    The cost centre of the port for billing purposes.
    createDate String
    The date the port was created.
    createdBy String
    The user who created the port.
    diversityZone String
    The diversity zone of the port.
    lagCount Number
    The number of ports in the LAG. Zero if the port is not part of a LAG.
    lagId Number
    Numeric ID of the LAG this port belongs to. Zero if the port is not part of a LAG.
    lagPortUids List<String>
    The unique identifiers of the ports in the LAG. Null if the port is not part of a LAG.
    lagPrimary Boolean
    Whether the port is a LAG primary.
    liveDate String
    The date the port went live.
    locationId Number
    The numeric location ID of the port.
    locked Boolean
    Whether the port is locked.
    market String
    The market the port is in.
    marketplaceVisibility Boolean
    Whether the port is visible in the Marketplace.
    portSpeed Number
    The bandwidth speed of the port in Mbps.
    productName String
    The name of the port.
    productUid String
    The unique identifier of the port.
    provisioningStatus String
    The provisioning status of the port.
    resourceTags Map<String>
    The resource tags associated with the port. Only populated when includeresourcetags is set to true; null otherwise (including when the port has no tags).
    secondaryName String
    The secondary name of the port.
    terminateDate String
    The date the port will be terminated.
    vxcAutoApproval Boolean
    Whether VXC connections are auto-approved on this port.
    vxcPermitted Boolean
    Whether VXC connections are permitted on this port.

    Package Details

    Repository
    megaport megaport/terraform-provider-megaport
    License
    Notes
    This Pulumi package is based on the megaport Terraform Provider.
    Viewing docs for megaport 1.19.1
    published on Monday, Sep 28, 2026 by megaport

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial