Viewing docs for civo 1.2.3
published on Thursday, Apr 9, 2026 by civo
published on Thursday, Apr 9, 2026 by civo
Viewing docs for civo 1.2.3
published on Thursday, Apr 9, 2026 by civo
published on Thursday, Apr 9, 2026 by civo
Retrieve information about a VPC subnet for use in other resources.
This data source provides all of the subnet’s properties as configured on your Civo account.
Subnets may be looked up by id or name, and require the network_id.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
const example = civo.getVpcSubnet({
name: "example-subnet",
networkId: exampleCivoVpcNetwork.id,
});
import pulumi
import pulumi_civo as civo
example = civo.get_vpc_subnet(name="example-subnet",
network_id=example_civo_vpc_network["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/civo/civo"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := civo.LookupVpcSubnet(ctx, &civo.LookupVpcSubnetArgs{
Name: pulumi.StringRef("example-subnet"),
NetworkId: exampleCivoVpcNetwork.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
return await Deployment.RunAsync(() =>
{
var example = Civo.GetVpcSubnet.Invoke(new()
{
Name = "example-subnet",
NetworkId = exampleCivoVpcNetwork.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetVpcSubnetArgs;
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 example = CivoFunctions.getVpcSubnet(GetVpcSubnetArgs.builder()
.name("example-subnet")
.networkId(exampleCivoVpcNetwork.id())
.build());
}
}
variables:
example:
fn::invoke:
function: civo:getVpcSubnet
arguments:
name: example-subnet
networkId: ${exampleCivoVpcNetwork.id}
Using getVpcSubnet
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 getVpcSubnet(args: GetVpcSubnetArgs, opts?: InvokeOptions): Promise<GetVpcSubnetResult>
function getVpcSubnetOutput(args: GetVpcSubnetOutputArgs, opts?: InvokeOptions): Output<GetVpcSubnetResult>def get_vpc_subnet(id: Optional[str] = None,
name: Optional[str] = None,
network_id: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcSubnetResult
def get_vpc_subnet_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
network_id: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcSubnetResult]func LookupVpcSubnet(ctx *Context, args *LookupVpcSubnetArgs, opts ...InvokeOption) (*LookupVpcSubnetResult, error)
func LookupVpcSubnetOutput(ctx *Context, args *LookupVpcSubnetOutputArgs, opts ...InvokeOption) LookupVpcSubnetResultOutput> Note: This function is named LookupVpcSubnet in the Go SDK.
public static class GetVpcSubnet
{
public static Task<GetVpcSubnetResult> InvokeAsync(GetVpcSubnetArgs args, InvokeOptions? opts = null)
public static Output<GetVpcSubnetResult> Invoke(GetVpcSubnetInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOptions options)
public static Output<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOptions options)
fn::invoke:
function: civo:index/getVpcSubnet:getVpcSubnet
arguments:
# arguments dictionaryThe following arguments are supported:
- network_
id str - The ID of the VPC network this subnet belongs to
- id str
- The ID of the VPC subnet
- name str
- The name of the VPC subnet
- region str
- The region of the subnet
getVpcSubnet Result
The following output properties are available:
- network_
id str - The ID of the VPC network this subnet belongs to
- status str
- The status of the subnet
- subnet_
size str - The size of the subnet
- id str
- The ID of the VPC subnet
- name str
- The name of the VPC subnet
- region str
- The region of the subnet
Package Details
- Repository
- Civo civo/terraform-provider-civo
- License
- Notes
- This Pulumi package is based on the
civoTerraform Provider.
Viewing docs for civo 1.2.3
published on Thursday, Apr 9, 2026 by civo
published on Thursday, Apr 9, 2026 by civo
