Civo

Pulumi Official
Package maintained by Pulumi
v2.2.4 published on Friday, Jul 29, 2022 by Pulumi

getNetwork

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 an expecific network inside that region.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Civo.GetNetwork.InvokeAsync(new Civo.GetNetworkArgs
        {
            Label = "test-network",
            Region = "NYC1",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := civo.LookupNetwork(ctx, &GetNetworkArgs{
			Label:  pulumi.StringRef("test-network"),
			Region: pulumi.StringRef("NYC1"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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("NYC1")
            .build());

    }
}
import pulumi
import pulumi_civo as civo

test = civo.get_network(label="test-network",
    region="NYC1")
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const test = pulumi.output(civo.getNetwork({
    label: "test-network",
    region: "NYC1",
}));
variables:
  test:
    Fn::Invoke:
      Function: civo:getNetwork
      Arguments:
        label: test-network
        region: NYC1

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: Optional[pulumi.Input[str]] = None,
                label: Optional[pulumi.Input[str]] = None,
                region: Optional[pulumi.Input[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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: civo:index/getNetwork:getNetwork
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Id string
Label string
Region string
Id string
Label string
Region string
id String
label String
region String
id string
label string
region string
id str
label str
region str
id String
label String
region String

getNetwork Result

The following output properties are available:

Default bool
Name string
Id string
Label string
Region string
Default bool
Name string
Id string
Label string
Region string
default_ Boolean
name String
id String
label String
region String
default boolean
name string
id string
label string
region string
default bool
name str
id str
label str
region str
default Boolean
name String
id String
label String
region String

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes

This Pulumi package is based on the civo Terraform Provider.