Class Subnet
Manages a V2 Neutron subnet 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.199.0/24",
NetworkId = network1.Id,
});
}
}
Inherited Members
Namespace: Pulumi.OpenStack.Networking
Assembly: Pulumi.OpenStack.dll
Syntax
public class Subnet : CustomResource
Constructors
View SourceSubnet(String, SubnetArgs, CustomResourceOptions)
Create a Subnet resource with the given unique name, arguments, and options.
Declaration
public Subnet(string name, SubnetArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| SubnetArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAllocationPools
A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_pool blocks can be declared, providing the subnet with more
than one range of IP addresses to use with DHCP. However, each IP range
must be from the same CIDR that the subnet is part of.
The allocation_pool block is documented below.
Declaration
public Output<ImmutableArray<SubnetAllocationPool>> AllocationPools { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<SubnetAllocationPool>> |
AllocationPoolsCollection
A block declaring the start and end range of the IP addresses available for
use with DHCP in this subnet.
The allocation_pools block is documented below.
Declaration
public Output<ImmutableArray<SubnetAllocationPoolsCollection>> AllocationPoolsCollection { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<SubnetAllocationPoolsCollection>> |
AllTags
The collection of ags assigned on the subnet, 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>> |
Cidr
CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
Declaration
public Output<string> Cidr { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
Human-readable description of the subnet. Changing this updates the name of the existing subnet.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DnsNameservers
An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
Declaration
public Output<ImmutableArray<string>> DnsNameservers { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
EnableDhcp
The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
Declaration
public Output<bool?> EnableDhcp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
GatewayIp
Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gateway will cause a default
gateway of .1 to be used. Changing this updates the gateway IP of the
existing subnet.
Declaration
public Output<string> GatewayIp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
HostRoutes
(Deprecated - use openstack.networking.SubnetRoute
instead) An array of routes that should be used by devices
with IPs from this subnet (not including local subnet route). The host_route
object structure is documented below. Changing this updates the host routes
for the existing subnet.
Declaration
public Output<ImmutableArray<SubnetHostRoute>> HostRoutes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<SubnetHostRoute>> |
Ipv6AddressMode
The IPv6 address mode. Valid values are
dhcpv6-stateful, dhcpv6-stateless, or slaac.
Declaration
public Output<string> Ipv6AddressMode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Ipv6RaMode
The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful, dhcpv6-stateless, or slaac.
Declaration
public Output<string> Ipv6RaMode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IpVersion
IP version, either 4 (default) or 6. Changing this creates a new subnet.
Declaration
public Output<int?> IpVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Name
The name of the subnet. Changing this updates the name of the existing subnet.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetworkId
The UUID of the parent network. Changing this creates a new subnet.
Declaration
public Output<string> NetworkId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NoGateway
Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
Declaration
public Output<bool?> NoGateway { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
PrefixLength
The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
Declaration
public Output<int?> PrefixLength { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Region
The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
region argument of the provider is used. Changing this creates a new
subnet.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SubnetpoolId
The ID of the subnetpool associated with the subnet.
Declaration
public Output<string> SubnetpoolId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
A set of string tags for the subnet.
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
TenantId
The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
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>, SubnetState, CustomResourceOptions)
Get an existing Subnet resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Subnet Get(string name, Input<string> id, SubnetState 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. |
| SubnetState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Subnet |