Viewing docs for civo 1.3.1
published on Thursday, Aug 6, 2026 by civo
published on Thursday, Aug 6, 2026 by civo
Viewing docs for civo 1.3.1
published on Thursday, Aug 6, 2026 by civo
published on Thursday, Aug 6, 2026 by civo
Retrieve information about a network for use in other resources.
This data source provides all of the network’s properties as configured on your Civo account.
Networks may be looked up by id or label, and you can optionally pass region if you want to make a lookup for a specific network inside that region.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
const test = civo.getNetwork({
label: "test-network",
region: "LON1",
});
export const networkCidrV4 = test.then(test => test.cidrV4);
export const networkNameserversV4 = test.then(test => test.nameserversV4s);
import pulumi
import pulumi_civo as civo
test = civo.get_network(label="test-network",
region="LON1")
pulumi.export("networkCidrV4", test.cidr_v4)
pulumi.export("networkNameserversV4", test.nameservers_v4s)
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 {
test, err := civo.LookupNetwork(ctx, &civo.LookupNetworkArgs{
Label: pulumi.StringRef("test-network"),
Region: pulumi.StringRef("LON1"),
}, nil)
if err != nil {
return err
}
ctx.Export("networkCidrV4", test.CidrV4)
ctx.Export("networkNameserversV4", test.NameserversV4s)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
return await Deployment.RunAsync(() =>
{
var test = Civo.GetNetwork.Invoke(new()
{
Label = "test-network",
Region = "LON1",
});
return new Dictionary<string, object?>
{
["networkCidrV4"] = test.Apply(getNetworkResult => getNetworkResult.CidrV4),
["networkNameserversV4"] = test.Apply(getNetworkResult => getNetworkResult.NameserversV4s),
};
});
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.GetNetworkArgs;
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 test = CivoFunctions.getNetwork(GetNetworkArgs.builder()
.label("test-network")
.region("LON1")
.build());
ctx.export("networkCidrV4", test.cidrV4());
ctx.export("networkNameserversV4", test.nameserversV4s());
}
}
variables:
test:
fn::invoke:
function: civo:getNetwork
arguments:
label: test-network
region: LON1
outputs:
networkCidrV4: ${test.cidrV4}
networkNameserversV4: ${test.nameserversV4s}
Example coming soon!
Using getNetwork
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 getNetwork(args: GetNetworkArgs, opts?: InvokeOptions): Promise<GetNetworkResult>
function getNetworkOutput(args: GetNetworkOutputArgs, opts?: InvokeOptions): Output<GetNetworkResult>def get_network(id: Optional[str] = None,
label: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNetworkResult
def get_network_output(id: pulumi.Input[Optional[str]] = None,
label: pulumi.Input[Optional[str]] = None,
region: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNetworkResult]func LookupNetwork(ctx *Context, args *LookupNetworkArgs, opts ...InvokeOption) (*LookupNetworkResult, error)
func LookupNetworkOutput(ctx *Context, args *LookupNetworkOutputArgs, opts ...InvokeOption) LookupNetworkResultOutput> Note: This function is named LookupNetwork in the Go SDK.
public static class GetNetwork
{
public static Task<GetNetworkResult> InvokeAsync(GetNetworkArgs args, InvokeOptions? opts = null)
public static Output<GetNetworkResult> Invoke(GetNetworkInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
public static Output<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
fn::invoke:
function: civo:index/getNetwork:getNetwork
arguments:
# arguments dictionarydata "civo_get_network" "name" {
# arguments
}The following arguments are supported:
getNetwork Result
The following output properties are available:
- cidr_
v4 string - The CIDR block for the network
- default bool
- If is the default network
- name string
- The name of the network
- nameservers_
v4s list(string) - List of nameservers for the network
- id string
- The ID of this resource.
- label string
- The label of an existing network
- region string
- The region of an existing network
- cidr
V4 String - The CIDR block for the network
- default_ Boolean
- If is the default network
- name String
- The name of the network
- nameservers
V4s List<String> - List of nameservers for the network
- id String
- The ID of this resource.
- label String
- The label of an existing network
- region String
- The region of an existing network
- cidr
V4 String - The CIDR block for the network
- default Boolean
- If is the default network
- name String
- The name of the network
- nameservers
V4s List<String> - List of nameservers for the network
- id String
- The ID of this resource.
- label String
- The label of an existing network
- region String
- The region of an existing network
Package Details
- Repository
- Civo civo/terraform-provider-civo
- License
- Notes
- This Pulumi package is based on the
civoTerraform Provider.
Viewing docs for civo 1.3.1
published on Thursday, Aug 6, 2026 by civo
published on Thursday, Aug 6, 2026 by civo