Class Subnet


  • public class Subnet
    extends com.pulumi.resources.CustomResource
    Manages a V2 Neutron subnet resource within OpenStack. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.openstack.networking.Network; import com.pulumi.openstack.networking.NetworkArgs; import com.pulumi.openstack.networking.Subnet; import com.pulumi.openstack.networking.SubnetArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var network1 = new Network("network1", NetworkArgs.builder() .adminStateUp("true") .build()); var subnet1 = new Subnet("subnet1", SubnetArgs.builder() .networkId(network1.id()) .cidr("192.168.199.0/24") .build()); } } ``` ## Import Subnets can be imported using the `id`, e.g. ```sh $ pulumi import openstack:networking/subnet:Subnet subnet_1 da4faf16-5546-41e4-8330-4d0002b74048 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Subnet​(java.lang.String name)  
      Subnet​(java.lang.String name, SubnetArgs args)  
      Subnet​(java.lang.String name, SubnetArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.List<SubnetAllocationPool>> allocationPools()  
      com.pulumi.core.Output<java.util.List<SubnetAllocationPoolsCollection>> allocationPoolsCollection()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> allTags()  
      com.pulumi.core.Output<java.lang.String> cidr()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> dnsNameservers()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableDhcp()  
      com.pulumi.core.Output<java.lang.String> gatewayIp()  
      static Subnet get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, SubnetState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.util.List<SubnetHostRoute>>> hostRoutes()  
      com.pulumi.core.Output<java.lang.String> ipv6AddressMode()  
      com.pulumi.core.Output<java.lang.String> ipv6RaMode()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> ipVersion()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> networkId()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> noGateway()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> prefixLength()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> serviceTypes()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> subnetpoolId()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> tags()  
      com.pulumi.core.Output<java.lang.String> tenantId()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>>> valueSpecs()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Subnet

        public Subnet​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Subnet

        public Subnet​(java.lang.String name,
                      SubnetArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Subnet

        public Subnet​(java.lang.String name,
                      SubnetArgs args,
                      @Nullable
                      com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • allTags

        public com.pulumi.core.Output<java.util.List<java.lang.String>> allTags()
        Returns:
        The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
      • allocationPools

        public com.pulumi.core.Output<java.util.List<SubnetAllocationPool>> allocationPools()
        Returns:
        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.
      • allocationPoolsCollection

        public com.pulumi.core.Output<java.util.List<SubnetAllocationPoolsCollection>> allocationPoolsCollection()
        Returns:
        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.
      • cidr

        public com.pulumi.core.Output<java.lang.String> cidr()
        Returns:
        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.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Human-readable description of the subnet. Changing this updates the name of the existing subnet.
      • dnsNameservers

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> dnsNameservers()
        Returns:
        An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
      • enableDhcp

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableDhcp()
        Returns:
        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.
      • gatewayIp

        public com.pulumi.core.Output<java.lang.String> gatewayIp()
        Returns:
        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.
      • hostRoutes

        public com.pulumi.core.Output<java.util.Optional<java.util.List<SubnetHostRoute>>> hostRoutes()
        Returns:
        (**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.
      • ipVersion

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> ipVersion()
        Returns:
        IP version, either 4 (default) or 6. Changing this creates a new subnet.
      • ipv6AddressMode

        public com.pulumi.core.Output<java.lang.String> ipv6AddressMode()
        Returns:
        The IPv6 address mode. Valid values are `dhcpv6-stateful`, `dhcpv6-stateless`, or `slaac`.
      • ipv6RaMode

        public com.pulumi.core.Output<java.lang.String> ipv6RaMode()
        Returns:
        The IPv6 Router Advertisement mode. Valid values are `dhcpv6-stateful`, `dhcpv6-stateless`, or `slaac`.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the subnet. Changing this updates the name of the existing subnet.
      • networkId

        public com.pulumi.core.Output<java.lang.String> networkId()
        Returns:
        The UUID of the parent network. Changing this creates a new subnet.
      • noGateway

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> noGateway()
        Returns:
        Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
      • prefixLength

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> prefixLength()
        Returns:
        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.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        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.
      • serviceTypes

        public com.pulumi.core.Output<java.util.List<java.lang.String>> serviceTypes()
        Returns:
        An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
      • subnetpoolId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> subnetpoolId()
        Returns:
        The ID of the subnetpool associated with the subnet.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> tags()
        Returns:
        A set of string tags for the subnet.
      • tenantId

        public com.pulumi.core.Output<java.lang.String> tenantId()
        Returns:
        The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
      • valueSpecs

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>>> valueSpecs()
        Returns:
        Map of additional options.
      • get

        public static Subnet get​(java.lang.String name,
                                 com.pulumi.core.Output<java.lang.String> id,
                                 @Nullable
                                 SubnetState state,
                                 @Nullable
                                 com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.