Trunk

Manages a networking V2 trunk resource within OpenStack.

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var network1 = new OpenStack.Networking.Network("network1", new OpenStack.Networking.NetworkArgs
        {
            AdminStateUp = true,
        });
        var subnet1 = new OpenStack.Networking.Subnet("subnet1", new OpenStack.Networking.SubnetArgs
        {
            Cidr = "192.168.1.0/24",
            EnableDhcp = true,
            IpVersion = 4,
            NetworkId = network1.Id,
            NoGateway = true,
        });
        var parentPort1 = new OpenStack.Networking.Port("parentPort1", new OpenStack.Networking.PortArgs
        {
            AdminStateUp = true,
            NetworkId = network1.Id,
        });
        var subport1 = new OpenStack.Networking.Port("subport1", new OpenStack.Networking.PortArgs
        {
            AdminStateUp = true,
            NetworkId = network1.Id,
        });
        var trunk1 = new OpenStack.Networking.Trunk("trunk1", new OpenStack.Networking.TrunkArgs
        {
            AdminStateUp = true,
            PortId = parentPort1.Id,
            SubPorts = 
            {
                new OpenStack.Networking.Inputs.TrunkSubPortArgs
                {
                    PortId = subport1.Id,
                    SegmentationId = 1,
                    SegmentationType = "vlan",
                },
            },
        });
        var instance1 = new OpenStack.Compute.Instance("instance1", new OpenStack.Compute.InstanceArgs
        {
            Networks = 
            {
                new OpenStack.Compute.Inputs.InstanceNetworkArgs
                {
                    Port = trunk1.PortId,
                },
            },
            SecurityGroups = 
            {
                "default",
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_openstack as openstack

network1 = openstack.networking.Network("network1", admin_state_up="true")
subnet1 = openstack.networking.Subnet("subnet1",
    cidr="192.168.1.0/24",
    enable_dhcp=True,
    ip_version=4,
    network_id=network1.id,
    no_gateway=True)
parent_port1 = openstack.networking.Port("parentPort1",
    admin_state_up="true",
    network_id=network1.id)
subport1 = openstack.networking.Port("subport1",
    admin_state_up="true",
    network_id=network1.id)
trunk1 = openstack.networking.Trunk("trunk1",
    admin_state_up="true",
    port_id=parent_port1.id,
    sub_ports=[{
        "port_id": subport1.id,
        "segmentation_id": 1,
        "segmentationType": "vlan",
    }])
instance1 = openstack.compute.Instance("instance1",
    networks=[{
        "port": trunk1.port_id,
    }],
    security_groups=["default"])
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const network1 = new openstack.networking.Network("network_1", {
    adminStateUp: true,
});
const subnet1 = new openstack.networking.Subnet("subnet_1", {
    cidr: "192.168.1.0/24",
    enableDhcp: true,
    ipVersion: 4,
    networkId: network1.id,
    noGateway: true,
});
const parentPort1 = new openstack.networking.Port("parent_port_1", {
    adminStateUp: true,
    networkId: network1.id,
}, { dependsOn: [subnet1] });
const subport1 = new openstack.networking.Port("subport_1", {
    adminStateUp: true,
    networkId: network1.id,
}, { dependsOn: [subnet1] });
const trunk1 = new openstack.networking.Trunk("trunk_1", {
    adminStateUp: true,
    portId: parentPort1.id,
    subPorts: [{
        portId: subport1.id,
        segmentationId: 1,
        segmentationType: "vlan",
    }],
});
const instance1 = new openstack.compute.Instance("instance_1", {
    networks: [{
        port: trunk1.portId,
    }],
    securityGroups: ["default"],
});

Create a Trunk Resource

new Trunk(name: string, args: TrunkArgs, opts?: CustomResourceOptions);
def Trunk(resource_name, opts=None, admin_state_up=None, description=None, name=None, port_id=None, region=None, sub_ports=None, tags=None, tenant_id=None, __props__=None);
func NewTrunk(ctx *Context, name string, args TrunkArgs, opts ...ResourceOption) (*Trunk, error)
public Trunk(string name, TrunkArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args TrunkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args TrunkArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TrunkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Trunk Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Trunk resource accepts the following input properties:

PortId string

The ID of the port to be made a subport of the trunk.

AdminStateUp bool

Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the admin_state_up of an existing trunk.

Description string

Human-readable description of the trunk. Changing this updates the name of the existing trunk.

Name string

A unique name for the trunk. Changing this updates the name of an existing trunk.

Region string

The region in which to obtain the V2 networking client. A networking client is needed to create a trunk. If omitted, the region argument of the provider is used. Changing this creates a new trunk.

SubPorts List<Pulumi.OpenStack.Networking.Inputs.TrunkSubPortArgs>

The set of ports that will be made subports of the trunk. The structure of each subport is described below.

Tags List<string>

A set of string tags for the port.

TenantId string

The owner of the Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.

PortId string

The ID of the port to be made a subport of the trunk.

AdminStateUp bool

Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the admin_state_up of an existing trunk.

Description string

Human-readable description of the trunk. Changing this updates the name of the existing trunk.

Name string

A unique name for the trunk. Changing this updates the name of an existing trunk.

Region string

The region in which to obtain the V2 networking client. A networking client is needed to create a trunk. If omitted, the region argument of the provider is used. Changing this creates a new trunk.

SubPorts []TrunkSubPort

The set of ports that will be made subports of the trunk. The structure of each subport is described below.

Tags []string

A set of string tags for the port.

TenantId string

The owner of the Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.

portId string

The ID of the port to be made a subport of the trunk.

adminStateUp boolean

Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the admin_state_up of an existing trunk.

description string

Human-readable description of the trunk. Changing this updates the name of the existing trunk.

name string

A unique name for the trunk. Changing this updates the name of an existing trunk.

region string

The region in which to obtain the V2 networking client. A networking client is needed to create a trunk. If omitted, the region argument of the provider is used. Changing this creates a new trunk.

subPorts TrunkSubPort[]

The set of ports that will be made subports of the trunk. The structure of each subport is described below.

tags string[]

A set of string tags for the port.

tenantId string

The owner of the Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.

port_id str

The ID of the port to be made a subport of the trunk.

admin_state_up bool

Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the admin_state_up of an existing trunk.

description str

Human-readable description of the trunk. Changing this updates the name of the existing trunk.

name str

A unique name for the trunk. Changing this updates the name of an existing trunk.

region str

The region in which to obtain the V2 networking client. A networking client is needed to create a trunk. If omitted, the region argument of the provider is used. Changing this creates a new trunk.

sub_ports List[TrunkSubPort]

The set of ports that will be made subports of the trunk. The structure of each subport is described below.

tags List[str]

A set of string tags for the port.

tenant_id str

The owner of the Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.

Outputs

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

AllTags List<string>

The collection of tags assigned on the trunk, which have been explicitly and implicitly added.

Id string
The provider-assigned unique ID for this managed resource.
AllTags []string

The collection of tags assigned on the trunk, which have been explicitly and implicitly added.

Id string
The provider-assigned unique ID for this managed resource.
allTags string[]

The collection of tags assigned on the trunk, which have been explicitly and implicitly added.

id string
The provider-assigned unique ID for this managed resource.
all_tags List[str]

The collection of tags assigned on the trunk, which have been explicitly and implicitly added.

id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Trunk Resource

Get an existing Trunk 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?: TrunkState, opts?: CustomResourceOptions): Trunk
static get(resource_name, id, opts=None, admin_state_up=None, all_tags=None, description=None, name=None, port_id=None, region=None, sub_ports=None, tags=None, tenant_id=None, __props__=None);
func GetTrunk(ctx *Context, name string, id IDInput, state *TrunkState, opts ...ResourceOption) (*Trunk, error)
public static Trunk Get(string name, Input<string> id, TrunkState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AdminStateUp bool

Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the admin_state_up of an existing trunk.

AllTags List<string>

The collection of tags assigned on the trunk, which have been explicitly and implicitly added.

Description string

Human-readable description of the trunk. Changing this updates the name of the existing trunk.

Name string

A unique name for the trunk. Changing this updates the name of an existing trunk.

PortId string

The ID of the port to be made a subport of the trunk.

Region string

The region in which to obtain the V2 networking client. A networking client is needed to create a trunk. If omitted, the region argument of the provider is used. Changing this creates a new trunk.

SubPorts List<Pulumi.OpenStack.Networking.Inputs.TrunkSubPortArgs>

The set of ports that will be made subports of the trunk. The structure of each subport is described below.

Tags List<string>

A set of string tags for the port.

TenantId string

The owner of the Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.

AdminStateUp bool

Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the admin_state_up of an existing trunk.

AllTags []string

The collection of tags assigned on the trunk, which have been explicitly and implicitly added.

Description string

Human-readable description of the trunk. Changing this updates the name of the existing trunk.

Name string

A unique name for the trunk. Changing this updates the name of an existing trunk.

PortId string

The ID of the port to be made a subport of the trunk.

Region string

The region in which to obtain the V2 networking client. A networking client is needed to create a trunk. If omitted, the region argument of the provider is used. Changing this creates a new trunk.

SubPorts []TrunkSubPort

The set of ports that will be made subports of the trunk. The structure of each subport is described below.

Tags []string

A set of string tags for the port.

TenantId string

The owner of the Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.

adminStateUp boolean

Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the admin_state_up of an existing trunk.

allTags string[]

The collection of tags assigned on the trunk, which have been explicitly and implicitly added.

description string

Human-readable description of the trunk. Changing this updates the name of the existing trunk.

name string

A unique name for the trunk. Changing this updates the name of an existing trunk.

portId string

The ID of the port to be made a subport of the trunk.

region string

The region in which to obtain the V2 networking client. A networking client is needed to create a trunk. If omitted, the region argument of the provider is used. Changing this creates a new trunk.

subPorts TrunkSubPort[]

The set of ports that will be made subports of the trunk. The structure of each subport is described below.

tags string[]

A set of string tags for the port.

tenantId string

The owner of the Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.

admin_state_up bool

Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the admin_state_up of an existing trunk.

all_tags List[str]

The collection of tags assigned on the trunk, which have been explicitly and implicitly added.

description str

Human-readable description of the trunk. Changing this updates the name of the existing trunk.

name str

A unique name for the trunk. Changing this updates the name of an existing trunk.

port_id str

The ID of the port to be made a subport of the trunk.

region str

The region in which to obtain the V2 networking client. A networking client is needed to create a trunk. If omitted, the region argument of the provider is used. Changing this creates a new trunk.

sub_ports List[TrunkSubPort]

The set of ports that will be made subports of the trunk. The structure of each subport is described below.

tags List[str]

A set of string tags for the port.

tenant_id str

The owner of the Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.

Supporting Types

TrunkSubPort

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

PortId string

The ID of the port to be made a subport of the trunk.

SegmentationId int

The numeric id of the subport segment.

SegmentationType string

The segmentation technology to use, e.g., “vlan”.

PortId string

The ID of the port to be made a subport of the trunk.

SegmentationId int

The numeric id of the subport segment.

SegmentationType string

The segmentation technology to use, e.g., “vlan”.

portId string

The ID of the port to be made a subport of the trunk.

segmentationId number

The numeric id of the subport segment.

segmentationType string

The segmentation technology to use, e.g., “vlan”.

port_id str

The ID of the port to be made a subport of the trunk.

segmentationType str

The segmentation technology to use, e.g., “vlan”.

segmentation_id float

The numeric id of the subport segment.

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes
This Pulumi package is based on the openstack Terraform Provider.