OpenStack v5.3.3 published on Friday, Sep 12, 2025 by Pulumi
openstack.networking.getTrunk
Use this data source to get the ID of an available OpenStack trunk.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const trunk1 = openstack.networking.getTrunk({
    name: "trunk_1",
});
import pulumi
import pulumi_openstack as openstack
trunk1 = openstack.networking.get_trunk(name="trunk_1")
package main
import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/networking"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := networking.LookupTrunk(ctx, &networking.LookupTrunkArgs{
			Name: pulumi.StringRef("trunk_1"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() => 
{
    var trunk1 = OpenStack.Networking.GetTrunk.Invoke(new()
    {
        Name = "trunk_1",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.networking.NetworkingFunctions;
import com.pulumi.openstack.networking.inputs.GetTrunkArgs;
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 trunk1 = NetworkingFunctions.getTrunk(GetTrunkArgs.builder()
            .name("trunk_1")
            .build());
    }
}
variables:
  trunk1:
    fn::invoke:
      function: openstack:networking:getTrunk
      arguments:
        name: trunk_1
Using getTrunk
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 getTrunk(args: GetTrunkArgs, opts?: InvokeOptions): Promise<GetTrunkResult>
function getTrunkOutput(args: GetTrunkOutputArgs, opts?: InvokeOptions): Output<GetTrunkResult>def get_trunk(admin_state_up: Optional[bool] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              port_id: Optional[str] = None,
              project_id: Optional[str] = None,
              region: Optional[str] = None,
              status: Optional[str] = None,
              tags: Optional[Sequence[str]] = None,
              trunk_id: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetTrunkResult
def get_trunk_output(admin_state_up: Optional[pulumi.Input[bool]] = None,
              description: Optional[pulumi.Input[str]] = None,
              name: Optional[pulumi.Input[str]] = None,
              port_id: Optional[pulumi.Input[str]] = None,
              project_id: Optional[pulumi.Input[str]] = None,
              region: Optional[pulumi.Input[str]] = None,
              status: Optional[pulumi.Input[str]] = None,
              tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
              trunk_id: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetTrunkResult]func LookupTrunk(ctx *Context, args *LookupTrunkArgs, opts ...InvokeOption) (*LookupTrunkResult, error)
func LookupTrunkOutput(ctx *Context, args *LookupTrunkOutputArgs, opts ...InvokeOption) LookupTrunkResultOutput> Note: This function is named LookupTrunk in the Go SDK.
public static class GetTrunk 
{
    public static Task<GetTrunkResult> InvokeAsync(GetTrunkArgs args, InvokeOptions? opts = null)
    public static Output<GetTrunkResult> Invoke(GetTrunkInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetTrunkResult> getTrunk(GetTrunkArgs args, InvokeOptions options)
public static Output<GetTrunkResult> getTrunk(GetTrunkArgs args, InvokeOptions options)
fn::invoke:
  function: openstack:networking/getTrunk:getTrunk
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AdminState boolUp 
- The administrative state of the trunk.
- Description string
- Human-readable description of the trunk.
- Name string
- The name of the trunk.
- PortId string
- The ID of the trunk parent port.
- ProjectId string
- The owner of the trunk.
- Region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve trunk ids. If omitted, the
regionargument of the provider is used.
- Status string
- The status of the trunk.
- List<string>
- The list of trunk tags to filter.
- TrunkId string
- The ID of the trunk.
- AdminState boolUp 
- The administrative state of the trunk.
- Description string
- Human-readable description of the trunk.
- Name string
- The name of the trunk.
- PortId string
- The ID of the trunk parent port.
- ProjectId string
- The owner of the trunk.
- Region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve trunk ids. If omitted, the
regionargument of the provider is used.
- Status string
- The status of the trunk.
- []string
- The list of trunk tags to filter.
- TrunkId string
- The ID of the trunk.
- adminState BooleanUp 
- The administrative state of the trunk.
- description String
- Human-readable description of the trunk.
- name String
- The name of the trunk.
- portId String
- The ID of the trunk parent port.
- projectId String
- The owner of the trunk.
- region String
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve trunk ids. If omitted, the
regionargument of the provider is used.
- status String
- The status of the trunk.
- List<String>
- The list of trunk tags to filter.
- trunkId String
- The ID of the trunk.
- adminState booleanUp 
- The administrative state of the trunk.
- description string
- Human-readable description of the trunk.
- name string
- The name of the trunk.
- portId string
- The ID of the trunk parent port.
- projectId string
- The owner of the trunk.
- region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve trunk ids. If omitted, the
regionargument of the provider is used.
- status string
- The status of the trunk.
- string[]
- The list of trunk tags to filter.
- trunkId string
- The ID of the trunk.
- admin_state_ boolup 
- The administrative state of the trunk.
- description str
- Human-readable description of the trunk.
- name str
- The name of the trunk.
- port_id str
- The ID of the trunk parent port.
- project_id str
- The owner of the trunk.
- region str
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve trunk ids. If omitted, the
regionargument of the provider is used.
- status str
- The status of the trunk.
- Sequence[str]
- The list of trunk tags to filter.
- trunk_id str
- The ID of the trunk.
- adminState BooleanUp 
- The administrative state of the trunk.
- description String
- Human-readable description of the trunk.
- name String
- The name of the trunk.
- portId String
- The ID of the trunk parent port.
- projectId String
- The owner of the trunk.
- region String
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve trunk ids. If omitted, the
regionargument of the provider is used.
- status String
- The status of the trunk.
- List<String>
- The list of trunk tags to filter.
- trunkId String
- The ID of the trunk.
getTrunk Result
The following output properties are available:
- List<string>
- The set of string tags applied on the trunk.
- Id string
- The provider-assigned unique ID for this managed resource.
- ProjectId string
- Region string
- SubPorts List<Pulumi.Open Stack. Networking. Outputs. Get Trunk Sub Port> 
- The set of the trunk subports. The structure of each subport is described below.
- AdminState boolUp 
- Description string
- Name string
- PortId string
- The ID of the trunk subport.
- Status string
- List<string>
- TrunkId string
- []string
- The set of string tags applied on the trunk.
- Id string
- The provider-assigned unique ID for this managed resource.
- ProjectId string
- Region string
- SubPorts []GetTrunk Sub Port 
- The set of the trunk subports. The structure of each subport is described below.
- AdminState boolUp 
- Description string
- Name string
- PortId string
- The ID of the trunk subport.
- Status string
- []string
- TrunkId string
- List<String>
- The set of string tags applied on the trunk.
- id String
- The provider-assigned unique ID for this managed resource.
- projectId String
- region String
- subPorts List<GetTrunk Sub Port> 
- The set of the trunk subports. The structure of each subport is described below.
- adminState BooleanUp 
- description String
- name String
- portId String
- The ID of the trunk subport.
- status String
- List<String>
- trunkId String
- string[]
- The set of string tags applied on the trunk.
- id string
- The provider-assigned unique ID for this managed resource.
- projectId string
- region string
- subPorts GetTrunk Sub Port[] 
- The set of the trunk subports. The structure of each subport is described below.
- adminState booleanUp 
- description string
- name string
- portId string
- The ID of the trunk subport.
- status string
- string[]
- trunkId string
- Sequence[str]
- The set of string tags applied on the trunk.
- id str
- The provider-assigned unique ID for this managed resource.
- project_id str
- region str
- sub_ports Sequence[GetTrunk Sub Port] 
- The set of the trunk subports. The structure of each subport is described below.
- admin_state_ boolup 
- description str
- name str
- port_id str
- The ID of the trunk subport.
- status str
- Sequence[str]
- trunk_id str
- List<String>
- The set of string tags applied on the trunk.
- id String
- The provider-assigned unique ID for this managed resource.
- projectId String
- region String
- subPorts List<Property Map>
- The set of the trunk subports. The structure of each subport is described below.
- adminState BooleanUp 
- description String
- name String
- portId String
- The ID of the trunk subport.
- status String
- List<String>
- trunkId String
Supporting Types
GetTrunkSubPort   
- PortId string
- The ID of the trunk parent port.
- SegmentationId int
- The numeric id of the subport segment.
- SegmentationType string
- The segmenation tecnology used, e.g., "vlan".
- PortId string
- The ID of the trunk parent port.
- SegmentationId int
- The numeric id of the subport segment.
- SegmentationType string
- The segmenation tecnology used, e.g., "vlan".
- portId String
- The ID of the trunk parent port.
- segmentationId Integer
- The numeric id of the subport segment.
- segmentationType String
- The segmenation tecnology used, e.g., "vlan".
- portId string
- The ID of the trunk parent port.
- segmentationId number
- The numeric id of the subport segment.
- segmentationType string
- The segmenation tecnology used, e.g., "vlan".
- port_id str
- The ID of the trunk parent port.
- segmentation_id int
- The numeric id of the subport segment.
- segmentation_type str
- The segmenation tecnology used, e.g., "vlan".
- portId String
- The ID of the trunk parent port.
- segmentationId Number
- The numeric id of the subport segment.
- segmentationType String
- The segmenation tecnology used, e.g., "vlan".
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the openstackTerraform Provider.
