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);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:
- Port
Id string The ID of the port to be made a subport of the trunk.
- Admin
State boolUp Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the
admin_state_upof 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
nameof 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
regionargument of the provider is used. Changing this creates a new trunk.- Sub
Ports List<Pulumi.Open Stack. Networking. Inputs. Trunk Sub Port Args> The set of ports that will be made subports of the trunk. The structure of each subport is described below.
- List<string>
A set of string tags for the port.
- Tenant
Id 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 string The ID of the port to be made a subport of the trunk.
- Admin
State boolUp Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the
admin_state_upof 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
nameof 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
regionargument of the provider is used. Changing this creates a new trunk.- Sub
Ports []TrunkSub Port The set of ports that will be made subports of the trunk. The structure of each subport is described below.
- []string
A set of string tags for the port.
- Tenant
Id 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 string The ID of the port to be made a subport of the trunk.
- admin
State booleanUp Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the
admin_state_upof 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
nameof 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
regionargument of the provider is used. Changing this creates a new trunk.- sub
Ports TrunkSub Port[] The set of ports that will be made subports of the trunk. The structure of each subport is described below.
- string[]
A set of string tags for the port.
- tenant
Id 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_ boolup Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the
admin_state_upof 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
nameof 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
regionargument of the provider is used. Changing this creates a new trunk.- sub_
ports List[TrunkSub Port] The set of ports that will be made subports of the trunk. The structure of each subport is described below.
- 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:
- 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.
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): Trunkstatic 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:
- Admin
State boolUp Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the
admin_state_upof an existing trunk.- 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
nameof an existing trunk.- Port
Id 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
regionargument of the provider is used. Changing this creates a new trunk.- Sub
Ports List<Pulumi.Open Stack. Networking. Inputs. Trunk Sub Port Args> The set of ports that will be made subports of the trunk. The structure of each subport is described below.
- List<string>
A set of string tags for the port.
- Tenant
Id 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 boolUp Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the
admin_state_upof an existing trunk.- []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
nameof an existing trunk.- Port
Id 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
regionargument of the provider is used. Changing this creates a new trunk.- Sub
Ports []TrunkSub Port The set of ports that will be made subports of the trunk. The structure of each subport is described below.
- []string
A set of string tags for the port.
- Tenant
Id 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 booleanUp Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the
admin_state_upof an existing trunk.- 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
nameof an existing trunk.- port
Id 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
regionargument of the provider is used. Changing this creates a new trunk.- sub
Ports TrunkSub Port[] The set of ports that will be made subports of the trunk. The structure of each subport is described below.
- string[]
A set of string tags for the port.
- tenant
Id 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_ boolup Administrative up/down status for the trunk (must be “true” or “false” if provided). Changing this updates the
admin_state_upof an existing trunk.- 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
nameof 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
regionargument of the provider is used. Changing this creates a new trunk.- sub_
ports List[TrunkSub Port] The set of ports that will be made subports of the trunk. The structure of each subport is described below.
- 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
- Port
Id string The ID of the port to be made a subport of the trunk.
- Segmentation
Id int The numeric id of the subport segment.
- Segmentation
Type string The segmentation technology to use, e.g., “vlan”.
- Port
Id string The ID of the port to be made a subport of the trunk.
- Segmentation
Id int The numeric id of the subport segment.
- Segmentation
Type string The segmentation technology to use, e.g., “vlan”.
- port
Id string The ID of the port to be made a subport of the trunk.
- segmentation
Id number The numeric id of the subport segment.
- segmentation
Type 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.
- segmentation
Type 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
openstackTerraform Provider.