@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
430 lines (429 loc) • 16 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Manages a V2 Neutron subnet resource within OpenStack.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const network1 = new openstack.networking.Network("network_1", {
* name: "tf_test_network",
* adminStateUp: true,
* });
* const subnet1 = new openstack.networking.Subnet("subnet_1", {
* networkId: network1.id,
* cidr: "192.168.199.0/24",
* });
* ```
*
* ## Import
*
* Subnets can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import openstack:networking/subnet:Subnet subnet_1 da4faf16-5546-41e4-8330-4d0002b74048
* ```
*/
export declare class Subnet extends pulumi.CustomResource {
/**
* Get an existing Subnet resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubnetState, opts?: pulumi.CustomResourceOptions): Subnet;
/**
* Returns true if the given object is an instance of Subnet. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Subnet;
/**
* The collection of ags assigned on the subnet, which have been
* explicitly and implicitly added.
*/
readonly allTags: pulumi.Output<string[]>;
/**
* A block declaring the start and end range of
* the IP addresses available for use with DHCP in this subnet. Multiple
* `allocationPool` 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 `allocationPool` block is documented below.
*/
readonly allocationPools: pulumi.Output<outputs.networking.SubnetAllocationPool[]>;
/**
* 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.
*/
readonly cidr: pulumi.Output<string>;
/**
* Human-readable description of the subnet. Changing this
* updates the name of the existing subnet.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* An array of DNS name server names used by hosts
* in this subnet. Changing this updates the DNS name servers for the existing
* subnet.
*/
readonly dnsNameservers: pulumi.Output<string[] | undefined>;
/**
* Whether to publish DNS records for IPs
* from this subnet. Defaults is false.
*/
readonly dnsPublishFixedIp: pulumi.Output<boolean | undefined>;
/**
* 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.
*/
readonly enableDhcp: pulumi.Output<boolean | undefined>;
/**
* Default gateway used by devices in this subnet.
* Leaving this blank and not setting `noGateway` will cause a default
* gateway of `.1` to be used. Changing this updates the gateway IP of the
* existing subnet.
*/
readonly gatewayIp: pulumi.Output<string>;
/**
* IP version, either 4 (default) or 6. Changing this creates a
* new subnet.
*/
readonly ipVersion: pulumi.Output<number | undefined>;
/**
* The IPv6 address mode. Valid values are
* `dhcpv6-stateful`, `dhcpv6-stateless`, or `slaac`.
*/
readonly ipv6AddressMode: pulumi.Output<string>;
/**
* The IPv6 Router Advertisement mode. Valid values
* are `dhcpv6-stateful`, `dhcpv6-stateless`, or `slaac`.
*/
readonly ipv6RaMode: pulumi.Output<string>;
/**
* The name of the subnet. Changing this updates the name of
* the existing subnet.
*/
readonly name: pulumi.Output<string>;
/**
* The UUID of the parent network. Changing this
* creates a new subnet.
*/
readonly networkId: pulumi.Output<string>;
/**
* Do not set a gateway IP on this subnet. Changing
* this removes or adds a default gateway IP of the existing subnet.
*/
readonly noGateway: pulumi.Output<boolean | undefined>;
/**
* 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.
*/
readonly prefixLength: pulumi.Output<number | undefined>;
/**
* 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.
*/
readonly region: pulumi.Output<string>;
/**
* The segment ID of the subnet. This is used to
* specify which segment the subnet belongs to when using Neutron's routed
* provider networks. Available when neutron segment extension is enabled.
*/
readonly segmentId: pulumi.Output<string | undefined>;
/**
* An array of service types used by the subnet.
* Changing this updates the service types for the existing subnet.
*/
readonly serviceTypes: pulumi.Output<string[]>;
/**
* The ID of the subnetpool associated with the subnet.
*/
readonly subnetpoolId: pulumi.Output<string | undefined>;
/**
* A set of string tags for the subnet.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* The owner of the subnet. Required if admin wants to
* create a subnet for another tenant. Changing this creates a new subnet.
*/
readonly tenantId: pulumi.Output<string>;
/**
* Map of additional options.
*/
readonly valueSpecs: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Create a Subnet resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: SubnetArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Subnet resources.
*/
export interface SubnetState {
/**
* The collection of ags assigned on the subnet, which have been
* explicitly and implicitly added.
*/
allTags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* A block declaring the start and end range of
* the IP addresses available for use with DHCP in this subnet. Multiple
* `allocationPool` 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 `allocationPool` block is documented below.
*/
allocationPools?: pulumi.Input<pulumi.Input<inputs.networking.SubnetAllocationPool>[]>;
/**
* 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.
*/
cidr?: pulumi.Input<string>;
/**
* Human-readable description of the subnet. Changing this
* updates the name of the existing subnet.
*/
description?: pulumi.Input<string>;
/**
* An array of DNS name server names used by hosts
* in this subnet. Changing this updates the DNS name servers for the existing
* subnet.
*/
dnsNameservers?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Whether to publish DNS records for IPs
* from this subnet. Defaults is false.
*/
dnsPublishFixedIp?: pulumi.Input<boolean>;
/**
* 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.
*/
enableDhcp?: pulumi.Input<boolean>;
/**
* Default gateway used by devices in this subnet.
* Leaving this blank and not setting `noGateway` will cause a default
* gateway of `.1` to be used. Changing this updates the gateway IP of the
* existing subnet.
*/
gatewayIp?: pulumi.Input<string>;
/**
* IP version, either 4 (default) or 6. Changing this creates a
* new subnet.
*/
ipVersion?: pulumi.Input<number>;
/**
* The IPv6 address mode. Valid values are
* `dhcpv6-stateful`, `dhcpv6-stateless`, or `slaac`.
*/
ipv6AddressMode?: pulumi.Input<string>;
/**
* The IPv6 Router Advertisement mode. Valid values
* are `dhcpv6-stateful`, `dhcpv6-stateless`, or `slaac`.
*/
ipv6RaMode?: pulumi.Input<string>;
/**
* The name of the subnet. Changing this updates the name of
* the existing subnet.
*/
name?: pulumi.Input<string>;
/**
* The UUID of the parent network. Changing this
* creates a new subnet.
*/
networkId?: pulumi.Input<string>;
/**
* Do not set a gateway IP on this subnet. Changing
* this removes or adds a default gateway IP of the existing subnet.
*/
noGateway?: pulumi.Input<boolean>;
/**
* 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.
*/
prefixLength?: pulumi.Input<number>;
/**
* 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.
*/
region?: pulumi.Input<string>;
/**
* The segment ID of the subnet. This is used to
* specify which segment the subnet belongs to when using Neutron's routed
* provider networks. Available when neutron segment extension is enabled.
*/
segmentId?: pulumi.Input<string>;
/**
* An array of service types used by the subnet.
* Changing this updates the service types for the existing subnet.
*/
serviceTypes?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The ID of the subnetpool associated with the subnet.
*/
subnetpoolId?: pulumi.Input<string>;
/**
* A set of string tags for the subnet.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The owner of the subnet. Required if admin wants to
* create a subnet for another tenant. Changing this creates a new subnet.
*/
tenantId?: pulumi.Input<string>;
/**
* Map of additional options.
*/
valueSpecs?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}
/**
* The set of arguments for constructing a Subnet resource.
*/
export interface SubnetArgs {
/**
* A block declaring the start and end range of
* the IP addresses available for use with DHCP in this subnet. Multiple
* `allocationPool` 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 `allocationPool` block is documented below.
*/
allocationPools?: pulumi.Input<pulumi.Input<inputs.networking.SubnetAllocationPool>[]>;
/**
* 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.
*/
cidr?: pulumi.Input<string>;
/**
* Human-readable description of the subnet. Changing this
* updates the name of the existing subnet.
*/
description?: pulumi.Input<string>;
/**
* An array of DNS name server names used by hosts
* in this subnet. Changing this updates the DNS name servers for the existing
* subnet.
*/
dnsNameservers?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Whether to publish DNS records for IPs
* from this subnet. Defaults is false.
*/
dnsPublishFixedIp?: pulumi.Input<boolean>;
/**
* 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.
*/
enableDhcp?: pulumi.Input<boolean>;
/**
* Default gateway used by devices in this subnet.
* Leaving this blank and not setting `noGateway` will cause a default
* gateway of `.1` to be used. Changing this updates the gateway IP of the
* existing subnet.
*/
gatewayIp?: pulumi.Input<string>;
/**
* IP version, either 4 (default) or 6. Changing this creates a
* new subnet.
*/
ipVersion?: pulumi.Input<number>;
/**
* The IPv6 address mode. Valid values are
* `dhcpv6-stateful`, `dhcpv6-stateless`, or `slaac`.
*/
ipv6AddressMode?: pulumi.Input<string>;
/**
* The IPv6 Router Advertisement mode. Valid values
* are `dhcpv6-stateful`, `dhcpv6-stateless`, or `slaac`.
*/
ipv6RaMode?: pulumi.Input<string>;
/**
* The name of the subnet. Changing this updates the name of
* the existing subnet.
*/
name?: pulumi.Input<string>;
/**
* The UUID of the parent network. Changing this
* creates a new subnet.
*/
networkId: pulumi.Input<string>;
/**
* Do not set a gateway IP on this subnet. Changing
* this removes or adds a default gateway IP of the existing subnet.
*/
noGateway?: pulumi.Input<boolean>;
/**
* 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.
*/
prefixLength?: pulumi.Input<number>;
/**
* 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.
*/
region?: pulumi.Input<string>;
/**
* The segment ID of the subnet. This is used to
* specify which segment the subnet belongs to when using Neutron's routed
* provider networks. Available when neutron segment extension is enabled.
*/
segmentId?: pulumi.Input<string>;
/**
* An array of service types used by the subnet.
* Changing this updates the service types for the existing subnet.
*/
serviceTypes?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The ID of the subnetpool associated with the subnet.
*/
subnetpoolId?: pulumi.Input<string>;
/**
* A set of string tags for the subnet.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The owner of the subnet. Required if admin wants to
* create a subnet for another tenant. Changing this creates a new subnet.
*/
tenantId?: pulumi.Input<string>;
/**
* Map of additional options.
*/
valueSpecs?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}