1. Packages
  2. Selectel Provider
  3. API Docs
  4. getDedicatedPublicSubnetV1
selectel 7.0.2-preview published on Wednesday, Oct 8, 2025 by selectel

selectel.getDedicatedPublicSubnetV1

Deploy with Pulumi
selectel logo
selectel 7.0.2-preview published on Wednesday, Oct 8, 2025 by selectel

    Provides a list of available public subnets.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const serverLocation = selectel.getDedicatedLocationV1({
        projectId: selectel_vpc_project_v2.project_1.id,
        filter: {
            name: "some-subnet",
        },
    });
    const publicSubnets = serverLocation.then(serverLocation => selectel.getDedicatedPublicSubnetV1({
        projectId: selectel_vpc_project_v2.project_1.id,
        filter: {
            locationId: serverLocation.locations?.[0]?.id,
            subnet: "192.168.1.0/29",
            ip: "192.168.1.3",
        },
    }));
    
    import pulumi
    import pulumi_selectel as selectel
    
    server_location = selectel.get_dedicated_location_v1(project_id=selectel_vpc_project_v2["project_1"]["id"],
        filter={
            "name": "some-subnet",
        })
    public_subnets = selectel.get_dedicated_public_subnet_v1(project_id=selectel_vpc_project_v2["project_1"]["id"],
        filter={
            "location_id": server_location.locations[0].id,
            "subnet": "192.168.1.0/29",
            "ip": "192.168.1.3",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v7/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		serverLocation, err := selectel.GetDedicatedLocationV1(ctx, &selectel.GetDedicatedLocationV1Args{
    			ProjectId: selectel_vpc_project_v2.Project_1.Id,
    			Filter: selectel.GetDedicatedLocationV1Filter{
    				Name: pulumi.StringRef("some-subnet"),
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = selectel.GetDedicatedPublicSubnetV1(ctx, &selectel.GetDedicatedPublicSubnetV1Args{
    			ProjectId: selectel_vpc_project_v2.Project_1.Id,
    			Filter: selectel.GetDedicatedPublicSubnetV1Filter{
    				LocationId: pulumi.StringRef(serverLocation.Locations[0].Id),
    				Subnet:     pulumi.StringRef("192.168.1.0/29"),
    				Ip:         pulumi.StringRef("192.168.1.3"),
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var serverLocation = Selectel.GetDedicatedLocationV1.Invoke(new()
        {
            ProjectId = selectel_vpc_project_v2.Project_1.Id,
            Filter = new Selectel.Inputs.GetDedicatedLocationV1FilterInputArgs
            {
                Name = "some-subnet",
            },
        });
    
        var publicSubnets = Selectel.GetDedicatedPublicSubnetV1.Invoke(new()
        {
            ProjectId = selectel_vpc_project_v2.Project_1.Id,
            Filter = new Selectel.Inputs.GetDedicatedPublicSubnetV1FilterInputArgs
            {
                LocationId = serverLocation.Apply(getDedicatedLocationV1Result => getDedicatedLocationV1Result.Locations[0]?.Id),
                Subnet = "192.168.1.0/29",
                Ip = "192.168.1.3",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.SelectelFunctions;
    import com.pulumi.selectel.inputs.GetDedicatedLocationV1Args;
    import com.pulumi.selectel.inputs.GetDedicatedLocationV1FilterArgs;
    import com.pulumi.selectel.inputs.GetDedicatedPublicSubnetV1Args;
    import com.pulumi.selectel.inputs.GetDedicatedPublicSubnetV1FilterArgs;
    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) {
            final var serverLocation = SelectelFunctions.getDedicatedLocationV1(GetDedicatedLocationV1Args.builder()
                .projectId(selectel_vpc_project_v2.project_1().id())
                .filter(GetDedicatedLocationV1FilterArgs.builder()
                    .name("some-subnet")
                    .build())
                .build());
    
            final var publicSubnets = SelectelFunctions.getDedicatedPublicSubnetV1(GetDedicatedPublicSubnetV1Args.builder()
                .projectId(selectel_vpc_project_v2.project_1().id())
                .filter(GetDedicatedPublicSubnetV1FilterArgs.builder()
                    .locationId(serverLocation.applyValue(getDedicatedLocationV1Result -> getDedicatedLocationV1Result.locations()[0].id()))
                    .subnet("192.168.1.0/29")
                    .ip("192.168.1.3")
                    .build())
                .build());
    
        }
    }
    
    variables:
      serverLocation:
        fn::invoke:
          function: selectel:getDedicatedLocationV1
          arguments:
            projectId: ${selectel_vpc_project_v2.project_1.id}
            filter:
              name: some-subnet
      publicSubnets:
        fn::invoke:
          function: selectel:getDedicatedPublicSubnetV1
          arguments:
            projectId: ${selectel_vpc_project_v2.project_1.id}
            filter:
              locationId: ${serverLocation.locations[0].id}
              subnet: 192.168.1.0/29
              ip: 192.168.1.3
    

    Using getDedicatedPublicSubnetV1

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDedicatedPublicSubnetV1(args: GetDedicatedPublicSubnetV1Args, opts?: InvokeOptions): Promise<GetDedicatedPublicSubnetV1Result>
    function getDedicatedPublicSubnetV1Output(args: GetDedicatedPublicSubnetV1OutputArgs, opts?: InvokeOptions): Output<GetDedicatedPublicSubnetV1Result>
    def get_dedicated_public_subnet_v1(filter: Optional[GetDedicatedPublicSubnetV1Filter] = None,
                                       id: Optional[str] = None,
                                       project_id: Optional[str] = None,
                                       opts: Optional[InvokeOptions] = None) -> GetDedicatedPublicSubnetV1Result
    def get_dedicated_public_subnet_v1_output(filter: Optional[pulumi.Input[GetDedicatedPublicSubnetV1FilterArgs]] = None,
                                       id: Optional[pulumi.Input[str]] = None,
                                       project_id: Optional[pulumi.Input[str]] = None,
                                       opts: Optional[InvokeOptions] = None) -> Output[GetDedicatedPublicSubnetV1Result]
    func GetDedicatedPublicSubnetV1(ctx *Context, args *GetDedicatedPublicSubnetV1Args, opts ...InvokeOption) (*GetDedicatedPublicSubnetV1Result, error)
    func GetDedicatedPublicSubnetV1Output(ctx *Context, args *GetDedicatedPublicSubnetV1OutputArgs, opts ...InvokeOption) GetDedicatedPublicSubnetV1ResultOutput

    > Note: This function is named GetDedicatedPublicSubnetV1 in the Go SDK.

    public static class GetDedicatedPublicSubnetV1 
    {
        public static Task<GetDedicatedPublicSubnetV1Result> InvokeAsync(GetDedicatedPublicSubnetV1Args args, InvokeOptions? opts = null)
        public static Output<GetDedicatedPublicSubnetV1Result> Invoke(GetDedicatedPublicSubnetV1InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDedicatedPublicSubnetV1Result> getDedicatedPublicSubnetV1(GetDedicatedPublicSubnetV1Args args, InvokeOptions options)
    public static Output<GetDedicatedPublicSubnetV1Result> getDedicatedPublicSubnetV1(GetDedicatedPublicSubnetV1Args args, InvokeOptions options)
    
    fn::invoke:
      function: selectel:index/getDedicatedPublicSubnetV1:getDedicatedPublicSubnetV1
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Filter GetDedicatedPublicSubnetV1Filter
    Values to filter available subnets.
    Id string
    Unique identifier of the subnet.
    ProjectId string
    Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Filter GetDedicatedPublicSubnetV1Filter
    Values to filter available subnets.
    Id string
    Unique identifier of the subnet.
    projectId String
    Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    filter GetDedicatedPublicSubnetV1Filter
    Values to filter available subnets.
    id String
    Unique identifier of the subnet.
    projectId string
    Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    filter GetDedicatedPublicSubnetV1Filter
    Values to filter available subnets.
    id string
    Unique identifier of the subnet.
    project_id str
    Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    filter GetDedicatedPublicSubnetV1Filter
    Values to filter available subnets.
    id str
    Unique identifier of the subnet.
    projectId String
    Unique identifier of the associated project. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    filter Property Map
    Values to filter available subnets.
    id String
    Unique identifier of the subnet.

    getDedicatedPublicSubnetV1 Result

    The following output properties are available:

    Id string
    Unique identifier of the subnet.
    ProjectId string
    Subnets List<GetDedicatedPublicSubnetV1Subnet>
    List of the available subnets:
    Filter GetDedicatedPublicSubnetV1Filter
    Id string
    Unique identifier of the subnet.
    ProjectId string
    Subnets []GetDedicatedPublicSubnetV1Subnet
    List of the available subnets:
    Filter GetDedicatedPublicSubnetV1Filter
    id String
    Unique identifier of the subnet.
    projectId String
    subnets List<GetDedicatedPublicSubnetV1Subnet>
    List of the available subnets:
    filter GetDedicatedPublicSubnetV1Filter
    id string
    Unique identifier of the subnet.
    projectId string
    subnets GetDedicatedPublicSubnetV1Subnet[]
    List of the available subnets:
    filter GetDedicatedPublicSubnetV1Filter
    id str
    Unique identifier of the subnet.
    project_id str
    subnets Sequence[GetDedicatedPublicSubnetV1Subnet]
    List of the available subnets:
    filter GetDedicatedPublicSubnetV1Filter
    id String
    Unique identifier of the subnet.
    projectId String
    subnets List<Property Map>
    List of the available subnets:
    filter Property Map

    Supporting Types

    GetDedicatedPublicSubnetV1Filter

    Ip string
    IP address to search included in a subnet.
    LocationId string
    Unique identifier of the location.
    Subnet string
    Subnet in CIDR notation to search.
    Ip string
    IP address to search included in a subnet.
    LocationId string
    Unique identifier of the location.
    Subnet string
    Subnet in CIDR notation to search.
    ip String
    IP address to search included in a subnet.
    locationId String
    Unique identifier of the location.
    subnet String
    Subnet in CIDR notation to search.
    ip string
    IP address to search included in a subnet.
    locationId string
    Unique identifier of the location.
    subnet string
    Subnet in CIDR notation to search.
    ip str
    IP address to search included in a subnet.
    location_id str
    Unique identifier of the location.
    subnet str
    Subnet in CIDR notation to search.
    ip String
    IP address to search included in a subnet.
    locationId String
    Unique identifier of the location.
    subnet String
    Subnet in CIDR notation to search.

    GetDedicatedPublicSubnetV1Subnet

    Broadcast string
    Broadcast address.
    Gateway string
    Gateway address.
    Id string
    Unique identifier of the subnet.
    NetworkId string
    Unique identifier of the network.
    ReservedVrrpIps List<string>
    List of reserved VRRP IPs.
    Subnet string
    Subnet in CIDR notation.
    Broadcast string
    Broadcast address.
    Gateway string
    Gateway address.
    Id string
    Unique identifier of the subnet.
    NetworkId string
    Unique identifier of the network.
    ReservedVrrpIps []string
    List of reserved VRRP IPs.
    Subnet string
    Subnet in CIDR notation.
    broadcast String
    Broadcast address.
    gateway String
    Gateway address.
    id String
    Unique identifier of the subnet.
    networkId String
    Unique identifier of the network.
    reservedVrrpIps List<String>
    List of reserved VRRP IPs.
    subnet String
    Subnet in CIDR notation.
    broadcast string
    Broadcast address.
    gateway string
    Gateway address.
    id string
    Unique identifier of the subnet.
    networkId string
    Unique identifier of the network.
    reservedVrrpIps string[]
    List of reserved VRRP IPs.
    subnet string
    Subnet in CIDR notation.
    broadcast str
    Broadcast address.
    gateway str
    Gateway address.
    id str
    Unique identifier of the subnet.
    network_id str
    Unique identifier of the network.
    reserved_vrrp_ips Sequence[str]
    List of reserved VRRP IPs.
    subnet str
    Subnet in CIDR notation.
    broadcast String
    Broadcast address.
    gateway String
    Gateway address.
    id String
    Unique identifier of the subnet.
    networkId String
    Unique identifier of the network.
    reservedVrrpIps List<String>
    List of reserved VRRP IPs.
    subnet String
    Subnet in CIDR notation.

    Package Details

    Repository
    selectel selectel/terraform-provider-selectel
    License
    Notes
    This Pulumi package is based on the selectel Terraform Provider.
    selectel logo
    selectel 7.0.2-preview published on Wednesday, Oct 8, 2025 by selectel
      Meet Neo: Your AI Platform Teammate