Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getGlobalDatabaseNetworks

This data source provides the PolarDB Global Database Networks of the current Alibaba Cloud user.

NOTE: Available in v1.181.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.PolarDB.GetGlobalDatabaseNetworks.InvokeAsync(new AliCloud.PolarDB.GetGlobalDatabaseNetworksArgs
        {
            Ids = 
            {
                "example_id",
            },
        }));
        this.PolardbGlobalDatabaseNetworkId1 = ids.Apply(ids => ids.Networks?[0]?.Id);
        var description = Output.Create(AliCloud.PolarDB.GetGlobalDatabaseNetworks.InvokeAsync(new AliCloud.PolarDB.GetGlobalDatabaseNetworksArgs
        {
            Description = "example_description",
        }));
        this.PolardbGlobalDatabaseNetworkId2 = description.Apply(description => description.Networks?[0]?.Id);
    }

    [Output("polardbGlobalDatabaseNetworkId1")]
    public Output<string> PolardbGlobalDatabaseNetworkId1 { get; set; }
    [Output("polardbGlobalDatabaseNetworkId2")]
    public Output<string> PolardbGlobalDatabaseNetworkId2 { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/polardb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := polardb.GetGlobalDatabaseNetworks(ctx, &polardb.GetGlobalDatabaseNetworksArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("polardbGlobalDatabaseNetworkId1", ids.Networks[0].Id)
		description, err := polardb.GetGlobalDatabaseNetworks(ctx, &polardb.GetGlobalDatabaseNetworksArgs{
			Description: pulumi.StringRef("example_description"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("polardbGlobalDatabaseNetworkId2", description.Networks[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.polardb.PolardbFunctions;
import com.pulumi.alicloud.polardb.inputs.GetGlobalDatabaseNetworksArgs;
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 ids = PolardbFunctions.getGlobalDatabaseNetworks(GetGlobalDatabaseNetworksArgs.builder()
            .ids("example_id")
            .build());

        ctx.export("polardbGlobalDatabaseNetworkId1", ids.applyValue(getGlobalDatabaseNetworksResult -> getGlobalDatabaseNetworksResult.networks()[0].id()));
        final var description = PolardbFunctions.getGlobalDatabaseNetworks(GetGlobalDatabaseNetworksArgs.builder()
            .description("example_description")
            .build());

        ctx.export("polardbGlobalDatabaseNetworkId2", description.applyValue(getGlobalDatabaseNetworksResult -> getGlobalDatabaseNetworksResult.networks()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.polardb.get_global_database_networks(ids=["example_id"])
pulumi.export("polardbGlobalDatabaseNetworkId1", ids.networks[0].id)
description = alicloud.polardb.get_global_database_networks(description="example_description")
pulumi.export("polardbGlobalDatabaseNetworkId2", description.networks[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.polardb.getGlobalDatabaseNetworks({
    ids: ["example_id"],
});
export const polardbGlobalDatabaseNetworkId1 = ids.then(ids => ids.networks?[0]?.id);
const description = alicloud.polardb.getGlobalDatabaseNetworks({
    description: "example_description",
});
export const polardbGlobalDatabaseNetworkId2 = description.then(description => description.networks?[0]?.id);
variables:
  ids:
    Fn::Invoke:
      Function: alicloud:polardb:getGlobalDatabaseNetworks
      Arguments:
        ids:
          - example_id
  description:
    Fn::Invoke:
      Function: alicloud:polardb:getGlobalDatabaseNetworks
      Arguments:
        description: example_description
outputs:
  polardbGlobalDatabaseNetworkId1: ${ids.networks[0].id}
  polardbGlobalDatabaseNetworkId2: ${description.networks[0].id}

Using getGlobalDatabaseNetworks

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 getGlobalDatabaseNetworks(args: GetGlobalDatabaseNetworksArgs, opts?: InvokeOptions): Promise<GetGlobalDatabaseNetworksResult>
function getGlobalDatabaseNetworksOutput(args: GetGlobalDatabaseNetworksOutputArgs, opts?: InvokeOptions): Output<GetGlobalDatabaseNetworksResult>
def get_global_database_networks(db_cluster_id: Optional[str] = None,
                                 description: Optional[str] = None,
                                 gdn_id: Optional[str] = None,
                                 ids: Optional[Sequence[str]] = None,
                                 output_file: Optional[str] = None,
                                 page_number: Optional[int] = None,
                                 page_size: Optional[int] = None,
                                 status: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetGlobalDatabaseNetworksResult
def get_global_database_networks_output(db_cluster_id: Optional[pulumi.Input[str]] = None,
                                 description: Optional[pulumi.Input[str]] = None,
                                 gdn_id: Optional[pulumi.Input[str]] = None,
                                 ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                 output_file: Optional[pulumi.Input[str]] = None,
                                 page_number: Optional[pulumi.Input[int]] = None,
                                 page_size: Optional[pulumi.Input[int]] = None,
                                 status: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetGlobalDatabaseNetworksResult]
func GetGlobalDatabaseNetworks(ctx *Context, args *GetGlobalDatabaseNetworksArgs, opts ...InvokeOption) (*GetGlobalDatabaseNetworksResult, error)
func GetGlobalDatabaseNetworksOutput(ctx *Context, args *GetGlobalDatabaseNetworksOutputArgs, opts ...InvokeOption) GetGlobalDatabaseNetworksResultOutput

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

public static class GetGlobalDatabaseNetworks 
{
    public static Task<GetGlobalDatabaseNetworksResult> InvokeAsync(GetGlobalDatabaseNetworksArgs args, InvokeOptions? opts = null)
    public static Output<GetGlobalDatabaseNetworksResult> Invoke(GetGlobalDatabaseNetworksInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetGlobalDatabaseNetworksResult> getGlobalDatabaseNetworks(GetGlobalDatabaseNetworksArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:polardb/getGlobalDatabaseNetworks:getGlobalDatabaseNetworks
  Arguments:
    # Arguments dictionary

The following arguments are supported:

DbClusterId string

The ID of the PolarDB cluster.

Description string

The description of the Global Database Network.

GdnId string

The ID of the Global Database Network.

Ids List<string>

A list of Global Database Network IDs.

OutputFile string
PageNumber int
PageSize int
Status string

The status of the Global Database Network.

DbClusterId string

The ID of the PolarDB cluster.

Description string

The description of the Global Database Network.

GdnId string

The ID of the Global Database Network.

Ids []string

A list of Global Database Network IDs.

OutputFile string
PageNumber int
PageSize int
Status string

The status of the Global Database Network.

dbClusterId String

The ID of the PolarDB cluster.

description String

The description of the Global Database Network.

gdnId String

The ID of the Global Database Network.

ids List<String>

A list of Global Database Network IDs.

outputFile String
pageNumber Integer
pageSize Integer
status String

The status of the Global Database Network.

dbClusterId string

The ID of the PolarDB cluster.

description string

The description of the Global Database Network.

gdnId string

The ID of the Global Database Network.

ids string[]

A list of Global Database Network IDs.

outputFile string
pageNumber number
pageSize number
status string

The status of the Global Database Network.

db_cluster_id str

The ID of the PolarDB cluster.

description str

The description of the Global Database Network.

gdn_id str

The ID of the Global Database Network.

ids Sequence[str]

A list of Global Database Network IDs.

output_file str
page_number int
page_size int
status str

The status of the Global Database Network.

dbClusterId String

The ID of the PolarDB cluster.

description String

The description of the Global Database Network.

gdnId String

The ID of the Global Database Network.

ids List<String>

A list of Global Database Network IDs.

outputFile String
pageNumber Number
pageSize Number
status String

The status of the Global Database Network.

getGlobalDatabaseNetworks Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Networks List<Pulumi.AliCloud.PolarDB.Outputs.GetGlobalDatabaseNetworksNetwork>
DbClusterId string
Description string
GdnId string
OutputFile string
PageNumber int
PageSize int
Status string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Networks []GetGlobalDatabaseNetworksNetwork
DbClusterId string
Description string
GdnId string
OutputFile string
PageNumber int
PageSize int
Status string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
networks List<GetGlobalDatabaseNetworksNetwork>
dbClusterId String
description String
gdnId String
outputFile String
pageNumber Integer
pageSize Integer
status String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
networks GetGlobalDatabaseNetworksNetwork[]
dbClusterId string
description string
gdnId string
outputFile string
pageNumber number
pageSize number
status string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
networks Sequence[GetGlobalDatabaseNetworksNetwork]
db_cluster_id str
description str
gdn_id str
output_file str
page_number int
page_size int
status str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
networks List<Property Map>
dbClusterId String
description String
gdnId String
outputFile String
pageNumber Number
pageSize Number
status String

Supporting Types

GetGlobalDatabaseNetworksNetwork

CreateTime string

The time when the Global Database Network was created. The time is in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

DbClusters List<Pulumi.AliCloud.PolarDB.Inputs.GetGlobalDatabaseNetworksNetworkDbCluster>

The details of each cluster in the Global Database Network.

DbType string

The type of the database engine. Only MySQL is supported.

DbVersion string

The version number of the database engine. Only the 8.0 version is supported.

Description string

The description of the Global Database Network.

GdnId string

The ID of the Global Database Network.

Id string

The ID of the Global Database Network.

Status string

The status of the Global Database Network.

CreateTime string

The time when the Global Database Network was created. The time is in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

DbClusters []GetGlobalDatabaseNetworksNetworkDbCluster

The details of each cluster in the Global Database Network.

DbType string

The type of the database engine. Only MySQL is supported.

DbVersion string

The version number of the database engine. Only the 8.0 version is supported.

Description string

The description of the Global Database Network.

GdnId string

The ID of the Global Database Network.

Id string

The ID of the Global Database Network.

Status string

The status of the Global Database Network.

createTime String

The time when the Global Database Network was created. The time is in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

dbClusters List<GetGlobalDatabaseNetworksNetworkDbCluster>

The details of each cluster in the Global Database Network.

dbType String

The type of the database engine. Only MySQL is supported.

dbVersion String

The version number of the database engine. Only the 8.0 version is supported.

description String

The description of the Global Database Network.

gdnId String

The ID of the Global Database Network.

id String

The ID of the Global Database Network.

status String

The status of the Global Database Network.

createTime string

The time when the Global Database Network was created. The time is in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

dbClusters GetGlobalDatabaseNetworksNetworkDbCluster[]

The details of each cluster in the Global Database Network.

dbType string

The type of the database engine. Only MySQL is supported.

dbVersion string

The version number of the database engine. Only the 8.0 version is supported.

description string

The description of the Global Database Network.

gdnId string

The ID of the Global Database Network.

id string

The ID of the Global Database Network.

status string

The status of the Global Database Network.

create_time str

The time when the Global Database Network was created. The time is in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

db_clusters Sequence[GetGlobalDatabaseNetworksNetworkDbCluster]

The details of each cluster in the Global Database Network.

db_type str

The type of the database engine. Only MySQL is supported.

db_version str

The version number of the database engine. Only the 8.0 version is supported.

description str

The description of the Global Database Network.

gdn_id str

The ID of the Global Database Network.

id str

The ID of the Global Database Network.

status str

The status of the Global Database Network.

createTime String

The time when the Global Database Network was created. The time is in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

dbClusters List<Property Map>

The details of each cluster in the Global Database Network.

dbType String

The type of the database engine. Only MySQL is supported.

dbVersion String

The version number of the database engine. Only the 8.0 version is supported.

description String

The description of the Global Database Network.

gdnId String

The ID of the Global Database Network.

id String

The ID of the Global Database Network.

status String

The status of the Global Database Network.

GetGlobalDatabaseNetworksNetworkDbCluster

DbClusterId string

The ID of the PolarDB cluster.

RegionId string

The region ID of the cluster.

Role string

The role of the cluster.

DbClusterId string

The ID of the PolarDB cluster.

RegionId string

The region ID of the cluster.

Role string

The role of the cluster.

dbClusterId String

The ID of the PolarDB cluster.

regionId String

The region ID of the cluster.

role String

The role of the cluster.

dbClusterId string

The ID of the PolarDB cluster.

regionId string

The region ID of the cluster.

role string

The role of the cluster.

db_cluster_id str

The ID of the PolarDB cluster.

region_id str

The region ID of the cluster.

role str

The role of the cluster.

dbClusterId String

The ID of the PolarDB cluster.

regionId String

The region ID of the cluster.

role String

The role of the cluster.

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.