Class Port
Manages a V2 port resource within OpenStack.
Example Usage
Simple port
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 port1 = new OpenStack.Networking.Port("port1", new OpenStack.Networking.PortArgs
{
AdminStateUp = "true",
NetworkId = network1.Id,
});
}
}
Port with physical binding information
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 port1 = new OpenStack.Networking.Port("port1", new OpenStack.Networking.PortArgs
{
AdminStateUp = "true",
Binding = new OpenStack.Networking.Inputs.PortBindingArgs
{
HostId = "b080b9cf-46e0-4ce8-ad47-0fd4accc872b",
Profile = @"{
""local_link_information"": [
{
""switch_info"": ""info1"",
""port_id"": ""Ethernet3/4"",
""switch_id"": ""12:34:56:78:9A:BC""
},
{
""switch_info"": ""info2"",
""port_id"": ""Ethernet3/4"",
""switch_id"": ""12:34:56:78:9A:BD""
}
],
""vlan_type"": ""allowed""
}
",
VnicType = "baremetal",
},
DeviceId = "cdf70fcf-c161-4f24-9c70-96b3f5a54b71",
DeviceOwner = "baremetal:none",
NetworkId = network1.Id,
});
}
}
Notes
Ports and Instances
There are some notes to consider when connecting Instances to networks using
Ports. Please see the openstack.compute.Instance documentation for further
documentation.
Inherited Members
Namespace: Pulumi.OpenStack.Networking
Assembly: Pulumi.OpenStack.dll
Syntax
public class Port : CustomResource
Constructors
View SourcePort(String, PortArgs, CustomResourceOptions)
Create a Port resource with the given unique name, arguments, and options.
Declaration
public Port(string name, PortArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| PortArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAdminStateUp
Administrative up/down status for the port
(must be "true" or "false" if provided). Changing this updates the
admin_state_up of an existing port.
Declaration
public Output<bool> AdminStateUp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
AllFixedIps
The collection of Fixed IP addresses on the port in the order returned by the Network v2 API.
Declaration
public Output<ImmutableArray<string>> AllFixedIps { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
AllowedAddressPairs
An IP/MAC Address pair of additional IP addresses that can be active on this port. The structure is described below.
Declaration
public Output<ImmutableArray<PortAllowedAddressPair>> AllowedAddressPairs { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<PortAllowedAddressPair>> |
AllSecurityGroupIds
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
Declaration
public Output<ImmutableArray<string>> AllSecurityGroupIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
AllTags
The collection of tags assigned on the port, which have been explicitly and implicitly added.
Declaration
public Output<ImmutableArray<string>> AllTags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Binding
The port binding allows to specify binding information for the port. The structure is described below.
Declaration
public Output<PortBinding> Binding { get; }
Property Value
| Type | Description |
|---|---|
| Output<PortBinding> |
Description
Human-readable description of the floating IP. Changing
this updates the description of an existing port.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DeviceId
The ID of the device attached to the port. Changing this creates a new port.
Declaration
public Output<string> DeviceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DeviceOwner
The device owner of the Port. Changing this creates a new port.
Declaration
public Output<string> DeviceOwner { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DnsAssignments
The list of maps representing port DNS assignments.
Declaration
public Output<ImmutableArray<ImmutableDictionary<string, object>>> DnsAssignments { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>> |
DnsName
The port DNS name. Available, when Neutron DNS extension is enabled.
Declaration
public Output<string> DnsName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ExtraDhcpOptions
An extra DHCP option that needs to be configured on the port. The structure is described below. Can be specified multiple times.
Declaration
public Output<ImmutableArray<PortExtraDhcpOption>> ExtraDhcpOptions { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<PortExtraDhcpOption>> |
FixedIps
An array of desired IPs for this port. The structure is described below.
Declaration
public Output<ImmutableArray<PortFixedIp>> FixedIps { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<PortFixedIp>> |
MacAddress
The additional MAC address.
Declaration
public Output<string> MacAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Name of the DHCP option.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetworkId
The ID of the network to attach the port to. Changing this creates a new port.
Declaration
public Output<string> NetworkId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NoFixedIp
Create a port with no fixed
IP address. This will also remove any fixed IPs previously set on a port. true
is the only valid value for this argument.
Declaration
public Output<bool?> NoFixedIp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
NoSecurityGroups
If set to
true, then no security groups are applied to the port. If set to false and
no security_group_ids are specified, then the Port will yield to the default
behavior of the Networking service, which is to usually apply the "default"
security group.
Declaration
public Output<bool?> NoSecurityGroups { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
PortSecurityEnabled
Whether to explicitly enable or disable
port security on the port. Port Security is usually enabled by default, so
omitting argument will usually result in a value of "true". Setting this
explicitly to false will disable port security. In order to disable port
security, the port must not have any security groups. Valid values are true
and false.
Declaration
public Output<bool> PortSecurityEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
QosPolicyId
Reference to the associated QoS policy.
Declaration
public Output<string> QosPolicyId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The region in which to obtain the V2 networking client.
A networking client is needed to create a port. If omitted, the
region argument of the provider is used. Changing this creates a new
port.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SecurityGroupIds
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
Declaration
public Output<ImmutableArray<string>> SecurityGroupIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
A set of string tags for the port.
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
TenantId
The owner of the Port. Required if admin wants to create a port for another tenant. Changing this creates a new port.
Declaration
public Output<string> TenantId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ValueSpecs
Map of additional options.
Declaration
public Output<ImmutableDictionary<string, object>> ValueSpecs { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Methods
View SourceGet(String, Input<String>, PortState, CustomResourceOptions)
Get an existing Port resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Port Get(string name, Input<string> id, PortState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| PortState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Port |