GetSubnet
Use this data source to get the ID of an available OpenStack subnet.
Example Usage
using Pulumi;
using OpenStack = Pulumi.OpenStack;
class MyStack : Stack
{
public MyStack()
{
var subnet1 = Output.Create(OpenStack.Networking.GetSubnet.InvokeAsync(new OpenStack.Networking.GetSubnetArgs
{
Name = "subnet_1",
}));
}
}
Coming soon!
import pulumi
import pulumi_openstack as openstack
subnet1 = openstack.networking.get_subnet(name="subnet_1")import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const subnet1 = pulumi.output(openstack.networking.getSubnet({
name: "subnet_1",
}, { async: true }));Using GetSubnet
function getSubnet(args: GetSubnetArgs, opts?: InvokeOptions): Promise<GetSubnetResult>function get_subnet(cidr=None, description=None, dhcp_disabled=None, dhcp_enabled=None, gateway_ip=None, ip_version=None, ipv6_address_mode=None, ipv6_ra_mode=None, name=None, network_id=None, region=None, subnet_id=None, subnetpool_id=None, tags=None, tenant_id=None, opts=None)func LookupSubnet(ctx *Context, args *LookupSubnetArgs, opts ...InvokeOption) (*LookupSubnetResult, error)Note: This function is named
LookupSubnetin the Go SDK.
public static class GetSubnet {
public static Task<GetSubnetResult> InvokeAsync(GetSubnetArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Cidr string
The CIDR of the subnet.
- Description string
Human-readable description for the subnet.
- Dhcp
Disabled bool If the subnet has DHCP disabled.
- Dhcp
Enabled bool If the subnet has DHCP enabled.
- Gateway
Ip string The IP of the subnet’s gateway.
- Ip
Version int The IP version of the subnet (either 4 or 6).
- Ipv6Address
Mode string The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.- Ipv6Ra
Mode string The IPv6 Router Advertisement mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.- Name string
The name of the subnet.
- Network
Id string The ID of the network the subnet belongs to.
- Region string
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the
regionargument of the provider is used.- Subnet
Id string The ID of the subnet.
- Subnetpool
Id string The ID of the subnetpool associated with the subnet.
- List<string>
The list of subnet tags to filter.
- Tenant
Id string The owner of the subnet.
- Cidr string
The CIDR of the subnet.
- Description string
Human-readable description for the subnet.
- Dhcp
Disabled bool If the subnet has DHCP disabled.
- Dhcp
Enabled bool If the subnet has DHCP enabled.
- Gateway
Ip string The IP of the subnet’s gateway.
- Ip
Version int The IP version of the subnet (either 4 or 6).
- Ipv6Address
Mode string The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.- Ipv6Ra
Mode string The IPv6 Router Advertisement mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.- Name string
The name of the subnet.
- Network
Id string The ID of the network the subnet belongs to.
- Region string
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the
regionargument of the provider is used.- Subnet
Id string The ID of the subnet.
- Subnetpool
Id string The ID of the subnetpool associated with the subnet.
- []string
The list of subnet tags to filter.
- Tenant
Id string The owner of the subnet.
- cidr string
The CIDR of the subnet.
- description string
Human-readable description for the subnet.
- dhcp
Disabled boolean If the subnet has DHCP disabled.
- dhcp
Enabled boolean If the subnet has DHCP enabled.
- gateway
Ip string The IP of the subnet’s gateway.
- ip
Version number The IP version of the subnet (either 4 or 6).
- ipv6Address
Mode string The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.- ipv6Ra
Mode string The IPv6 Router Advertisement mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.- name string
The name of the subnet.
- network
Id string The ID of the network the subnet belongs to.
- region string
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the
regionargument of the provider is used.- subnet
Id string The ID of the subnet.
- subnetpool
Id string The ID of the subnetpool associated with the subnet.
- string[]
The list of subnet tags to filter.
- tenant
Id string The owner of the subnet.
- cidr str
The CIDR of the subnet.
- description str
Human-readable description for the subnet.
- dhcp_
disabled bool If the subnet has DHCP disabled.
- dhcp_
enabled bool If the subnet has DHCP enabled.
- gateway_
ip str The IP of the subnet’s gateway.
- ip_
version float The IP version of the subnet (either 4 or 6).
- ipv6_
address_ strmode The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.- ipv6_
ra_ strmode The IPv6 Router Advertisement mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.- name str
The name of the subnet.
- network_
id str The ID of the network the subnet belongs to.
- region str
The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve subnet ids. If omitted, the
regionargument of the provider is used.- subnet_
id str The ID of the subnet.
- subnetpool_
id str The ID of the subnetpool associated with the subnet.
- List[str]
The list of subnet tags to filter.
- tenant_
id str The owner of the subnet.
GetSubnet Result
The following output properties are available:
- List<string>
A set of string tags applied on the subnet.
- Allocation
Pools List<Pulumi.Open Stack. Networking. Outputs. Get Subnet Allocation Pool> Allocation pools of the subnet.
- Cidr string
- Description string
- Dns
Nameservers List<string> DNS Nameservers of the subnet.
- Enable
Dhcp bool Whether the subnet has DHCP enabled or not.
- Gateway
Ip string - Host
Routes List<Pulumi.Open Stack. Networking. Outputs. Get Subnet Host Route> Host Routes of the subnet.
- Id string
The provider-assigned unique ID for this managed resource.
- Ip
Version int - Ipv6Address
Mode string - Ipv6Ra
Mode string - Name string
- Network
Id string - Region string
See Argument Reference above.
- Subnet
Id string - Subnetpool
Id string - Tenant
Id string - Dhcp
Disabled bool - Dhcp
Enabled bool - List<string>
- []string
A set of string tags applied on the subnet.
- Allocation
Pools []GetSubnet Allocation Pool Allocation pools of the subnet.
- Cidr string
- Description string
- Dns
Nameservers []string DNS Nameservers of the subnet.
- Enable
Dhcp bool Whether the subnet has DHCP enabled or not.
- Gateway
Ip string - Host
Routes []GetSubnet Host Route Host Routes of the subnet.
- Id string
The provider-assigned unique ID for this managed resource.
- Ip
Version int - Ipv6Address
Mode string - Ipv6Ra
Mode string - Name string
- Network
Id string - Region string
See Argument Reference above.
- Subnet
Id string - Subnetpool
Id string - Tenant
Id string - Dhcp
Disabled bool - Dhcp
Enabled bool - []string
- string[]
A set of string tags applied on the subnet.
- allocation
Pools GetSubnet Allocation Pool[] Allocation pools of the subnet.
- cidr string
- description string
- dns
Nameservers string[] DNS Nameservers of the subnet.
- enable
Dhcp boolean Whether the subnet has DHCP enabled or not.
- gateway
Ip string - host
Routes GetSubnet Host Route[] Host Routes of the subnet.
- id string
The provider-assigned unique ID for this managed resource.
- ip
Version number - ipv6Address
Mode string - ipv6Ra
Mode string - name string
- network
Id string - region string
See Argument Reference above.
- subnet
Id string - subnetpool
Id string - tenant
Id string - dhcp
Disabled boolean - dhcp
Enabled boolean - string[]
- List[str]
A set of string tags applied on the subnet.
- allocation_
pools List[GetSubnet Allocation Pool] Allocation pools of the subnet.
- cidr str
- description str
- dns_
nameservers List[str] DNS Nameservers of the subnet.
- enable_
dhcp bool Whether the subnet has DHCP enabled or not.
- gateway_
ip str - host_
routes List[GetSubnet Host Route] Host Routes of the subnet.
- id str
The provider-assigned unique ID for this managed resource.
- ip_
version float - ipv6_
address_ strmode - ipv6_
ra_ strmode - name str
- network_
id str - region str
See Argument Reference above.
- subnet_
id str - subnetpool_
id str - tenant_
id str - dhcp_
disabled bool - dhcp_
enabled bool - List[str]
Supporting Types
GetSubnetAllocationPool
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetSubnetHostRoute
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
Package Details
- Repository
- https://github.com/pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstackTerraform Provider.