getNetworks

This data source provides Cloud Connect Networks available to the user.

NOTE: Available in 1.59.0+

NOTE: Only the following regions support create Cloud Connect Network. [cn-shanghai, cn-shanghai-finance-1, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1]

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultNetworks = Output.Create(AliCloud.CloudConnect.GetNetworks.InvokeAsync(new AliCloud.CloudConnect.GetNetworksArgs
        {
            Ids = 
            {
                alicloud_cloud_connect_networks.Default.Id,
            },
            NameRegex = "^tf-testAcc.*",
        }));
        var defaultNetwork = new AliCloud.CloudConnect.Network("defaultNetwork", new AliCloud.CloudConnect.NetworkArgs
        {
            CidrBlock = "192.168.0.0/24",
            Description = "tf-testAccCloudConnectNetworkDescription",
            IsDefault = true,
        });
    }

}

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cloudconnect.CloudconnectFunctions;
import com.pulumi.alicloud.cloudconnect.inputs.GetNetworksArgs;
import com.pulumi.alicloud.cloudconnect.Network;
import com.pulumi.alicloud.cloudconnect.NetworkArgs;
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 defaultNetworks = CloudconnectFunctions.getNetworks(GetNetworksArgs.builder()
            .ids(alicloud_cloud_connect_networks.default().id())
            .nameRegex("^tf-testAcc.*")
            .build());

        var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
            .cidrBlock("192.168.0.0/24")
            .description("tf-testAccCloudConnectNetworkDescription")
            .isDefault(true)
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_networks = alicloud.cloudconnect.get_networks(ids=[alicloud_cloud_connect_networks["default"]["id"]],
    name_regex="^tf-testAcc.*")
default_network = alicloud.cloudconnect.Network("defaultNetwork",
    cidr_block="192.168.0.0/24",
    description="tf-testAccCloudConnectNetworkDescription",
    is_default=True)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultNetworks = alicloud_cloud_connect_networks_default.id.apply(id => alicloud.cloudconnect.getNetworks({
    ids: [id],
    nameRegex: "^tf-testAcc.*",
}));
const defaultNetwork = new alicloud.cloudconnect.Network("default", {
    cidrBlock: "192.168.0.0/24",
    description: "tf-testAccCloudConnectNetworkDescription",
    isDefault: true,
});
resources:
  defaultNetwork:
    type: alicloud:cloudconnect:Network
    properties:
      cidrBlock: 192.168.0.0/24
      description: tf-testAccCloudConnectNetworkDescription
      isDefault: true
variables:
  defaultNetworks:
    Fn::Invoke:
      Function: alicloud:cloudconnect:getNetworks
      Arguments:
        ids:
          - ${alicloud_cloud_connect_networks.default.id}
        nameRegex: ^tf-testAcc.*

Using getNetworks

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 getNetworks(args: GetNetworksArgs, opts?: InvokeOptions): Promise<GetNetworksResult>
function getNetworksOutput(args: GetNetworksOutputArgs, opts?: InvokeOptions): Output<GetNetworksResult>
def get_networks(ids: Optional[Sequence[str]] = None,
                 name_regex: Optional[str] = None,
                 output_file: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetNetworksResult
def get_networks_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name_regex: Optional[pulumi.Input[str]] = None,
                 output_file: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetNetworksResult]
func GetNetworks(ctx *Context, args *GetNetworksArgs, opts ...InvokeOption) (*GetNetworksResult, error)
func GetNetworksOutput(ctx *Context, args *GetNetworksOutputArgs, opts ...InvokeOption) GetNetworksResultOutput

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

public static class GetNetworks 
{
    public static Task<GetNetworksResult> InvokeAsync(GetNetworksArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworksResult> Invoke(GetNetworksInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNetworksResult> getNetworks(GetNetworksArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:cloudconnect/getNetworks:getNetworks
  arguments:
    # arguments dictionary

The following arguments are supported:

Ids List<string>

A list of CCN instances IDs.

NameRegex string

A regex string to filter CCN instances by name.

OutputFile string
Ids []string

A list of CCN instances IDs.

NameRegex string

A regex string to filter CCN instances by name.

OutputFile string
ids List<String>

A list of CCN instances IDs.

nameRegex String

A regex string to filter CCN instances by name.

outputFile String
ids string[]

A list of CCN instances IDs.

nameRegex string

A regex string to filter CCN instances by name.

outputFile string
ids Sequence[str]

A list of CCN instances IDs.

name_regex str

A regex string to filter CCN instances by name.

output_file str
ids List<String>

A list of CCN instances IDs.

nameRegex String

A regex string to filter CCN instances by name.

outputFile String

getNetworks Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of CCN instances IDs.

Names List<string>

A list of CCN instances names.

Networks List<Pulumi.AliCloud.CloudConnect.Outputs.GetNetworksNetwork>

A list of CCN instances. Each element contains the following attributes:

NameRegex string
OutputFile string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of CCN instances IDs.

Names []string

A list of CCN instances names.

Networks []GetNetworksNetwork

A list of CCN instances. Each element contains the following attributes:

NameRegex string
OutputFile string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of CCN instances IDs.

names List<String>

A list of CCN instances names.

networks List<GetNetworksNetwork>

A list of CCN instances. Each element contains the following attributes:

nameRegex String
outputFile String
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of CCN instances IDs.

names string[]

A list of CCN instances names.

networks GetNetworksNetwork[]

A list of CCN instances. Each element contains the following attributes:

nameRegex string
outputFile string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of CCN instances IDs.

names Sequence[str]

A list of CCN instances names.

networks Sequence[GetNetworksNetwork]

A list of CCN instances. Each element contains the following attributes:

name_regex str
output_file str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of CCN instances IDs.

names List<String>

A list of CCN instances names.

networks List<Property Map>

A list of CCN instances. Each element contains the following attributes:

nameRegex String
outputFile String

Supporting Types

GetNetworksNetwork

CidrBlock string

CidrBlock of the CCN instance.

Description string
Id string

ID of the CCN instance.

IsDefault bool

IsDefault of the CCN instance.

Name string

Name of the CCN instance.

CidrBlock string

CidrBlock of the CCN instance.

Description string
Id string

ID of the CCN instance.

IsDefault bool

IsDefault of the CCN instance.

Name string

Name of the CCN instance.

cidrBlock String

CidrBlock of the CCN instance.

description String
id String

ID of the CCN instance.

isDefault Boolean

IsDefault of the CCN instance.

name String

Name of the CCN instance.

cidrBlock string

CidrBlock of the CCN instance.

description string
id string

ID of the CCN instance.

isDefault boolean

IsDefault of the CCN instance.

name string

Name of the CCN instance.

cidr_block str

CidrBlock of the CCN instance.

description str
id str

ID of the CCN instance.

is_default bool

IsDefault of the CCN instance.

name str

Name of the CCN instance.

cidrBlock String

CidrBlock of the CCN instance.

description String
id String

ID of the CCN instance.

isDefault Boolean

IsDefault of the CCN instance.

name String

Name of the CCN instance.

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.