alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.polardb.getEndpoints

The alicloud.polardb.getEndpoints data source provides a collection of PolarDB endpoints available in Alibaba Cloud account. Filters support regular expression for the cluster name, searches by clusterId, and other filters which are listed below.

NOTE: Available in v1.68.0+.

Example Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var polardbClustersDs = AliCloud.PolarDB.GetClusters.Invoke(new()
    {
        DescriptionRegex = "pc-\\w+",
        Status = "Running",
    });

    var @default = AliCloud.PolarDB.GetEndpoints.Invoke(new()
    {
        DbClusterId = polardbClustersDs.Apply(getClustersResult => getClustersResult.Clusters[0]?.Id),
    });

    return new Dictionary<string, object?>
    {
        ["endpoint"] = @default.Apply(@default => @default.Apply(getEndpointsResult => getEndpointsResult.Endpoints[0]?.DbEndpointId)),
    };
});
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 {
		polardbClustersDs, err := polardb.GetClusters(ctx, &polardb.GetClustersArgs{
			DescriptionRegex: pulumi.StringRef("pc-\\w+"),
			Status:           pulumi.StringRef("Running"),
		}, nil)
		if err != nil {
			return err
		}
		_default, err := polardb.GetEndpoints(ctx, &polardb.GetEndpointsArgs{
			DbClusterId: polardbClustersDs.Clusters[0].Id,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("endpoint", _default.Endpoints[0].DbEndpointId)
		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.GetClustersArgs;
import com.pulumi.alicloud.polardb.inputs.GetEndpointsArgs;
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 polardbClustersDs = PolardbFunctions.getClusters(GetClustersArgs.builder()
            .descriptionRegex("pc-\\w+")
            .status("Running")
            .build());

        final var default = PolardbFunctions.getEndpoints(GetEndpointsArgs.builder()
            .dbClusterId(polardbClustersDs.applyValue(getClustersResult -> getClustersResult.clusters()[0].id()))
            .build());

        ctx.export("endpoint", default_.endpoints()[0].dbEndpointId());
    }
}
import pulumi
import pulumi_alicloud as alicloud

polardb_clusters_ds = alicloud.polardb.get_clusters(description_regex="pc-\\w+",
    status="Running")
default = alicloud.polardb.get_endpoints(db_cluster_id=polardb_clusters_ds.clusters[0].id)
pulumi.export("endpoint", default.endpoints[0].db_endpoint_id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const polardbClustersDs = alicloud.polardb.getClusters({
    descriptionRegex: "pc-\\w+",
    status: "Running",
});
const default = polardbClustersDs.then(polardbClustersDs => alicloud.polardb.getEndpoints({
    dbClusterId: polardbClustersDs.clusters?.[0]?.id,
}));
export const endpoint = _default.then(_default => _default.endpoints?.[0]?.dbEndpointId);
variables:
  polardbClustersDs:
    fn::invoke:
      Function: alicloud:polardb:getClusters
      Arguments:
        descriptionRegex: pc-\w+
        status: Running
  default:
    fn::invoke:
      Function: alicloud:polardb:getEndpoints
      Arguments:
        dbClusterId: ${polardbClustersDs.clusters[0].id}
outputs:
  endpoint: ${default.endpoints[0].dbEndpointId}

Using getEndpoints

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 getEndpoints(args: GetEndpointsArgs, opts?: InvokeOptions): Promise<GetEndpointsResult>
function getEndpointsOutput(args: GetEndpointsOutputArgs, opts?: InvokeOptions): Output<GetEndpointsResult>
def get_endpoints(db_cluster_id: Optional[str] = None,
                  db_endpoint_id: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetEndpointsResult
def get_endpoints_output(db_cluster_id: Optional[pulumi.Input[str]] = None,
                  db_endpoint_id: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetEndpointsResult]
func GetEndpoints(ctx *Context, args *GetEndpointsArgs, opts ...InvokeOption) (*GetEndpointsResult, error)
func GetEndpointsOutput(ctx *Context, args *GetEndpointsOutputArgs, opts ...InvokeOption) GetEndpointsResultOutput

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

public static class GetEndpoints 
{
    public static Task<GetEndpointsResult> InvokeAsync(GetEndpointsArgs args, InvokeOptions? opts = null)
    public static Output<GetEndpointsResult> Invoke(GetEndpointsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetEndpointsResult> getEndpoints(GetEndpointsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:polardb/getEndpoints:getEndpoints
  arguments:
    # arguments dictionary

The following arguments are supported:

DbClusterId string

PolarDB cluster ID.

DbEndpointId string

endpoint of the cluster.

DbClusterId string

PolarDB cluster ID.

DbEndpointId string

endpoint of the cluster.

dbClusterId String

PolarDB cluster ID.

dbEndpointId String

endpoint of the cluster.

dbClusterId string

PolarDB cluster ID.

dbEndpointId string

endpoint of the cluster.

db_cluster_id str

PolarDB cluster ID.

db_endpoint_id str

endpoint of the cluster.

dbClusterId String

PolarDB cluster ID.

dbEndpointId String

endpoint of the cluster.

getEndpoints Result

The following output properties are available:

DbClusterId string
Endpoints List<Pulumi.AliCloud.PolarDB.Outputs.GetEndpointsEndpoint>

A list of PolarDB cluster endpoints. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

DbEndpointId string

The endpoint ID.

DbClusterId string
Endpoints []GetEndpointsEndpoint

A list of PolarDB cluster endpoints. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

DbEndpointId string

The endpoint ID.

dbClusterId String
endpoints List<GetEndpointsEndpoint>

A list of PolarDB cluster endpoints. Each element contains the following attributes:

id String

The provider-assigned unique ID for this managed resource.

dbEndpointId String

The endpoint ID.

dbClusterId string
endpoints GetEndpointsEndpoint[]

A list of PolarDB cluster endpoints. Each element contains the following attributes:

id string

The provider-assigned unique ID for this managed resource.

dbEndpointId string

The endpoint ID.

db_cluster_id str
endpoints Sequence[GetEndpointsEndpoint]

A list of PolarDB cluster endpoints. Each element contains the following attributes:

id str

The provider-assigned unique ID for this managed resource.

db_endpoint_id str

The endpoint ID.

dbClusterId String
endpoints List<Property Map>

A list of PolarDB cluster endpoints. Each element contains the following attributes:

id String

The provider-assigned unique ID for this managed resource.

dbEndpointId String

The endpoint ID.

Supporting Types

GetEndpointsEndpoint

AddressItems List<Pulumi.AliCloud.PolarDB.Inputs.GetEndpointsEndpointAddressItem>

A list of endpoint addresses. Each element contains the following attributes.

AutoAddNewNodes string

Whether the new node is automatically added to the default cluster address.Options are Enable and Disable.

DbEndpointId string

endpoint of the cluster.

EndpointConfig string

The Endpoint configuration. ConsistLevel: session consistency level, value:0: final consistency,1: session consistency;LoadBalanceStrategy: load balancing strategy. Based on the automatic scheduling of load, the value is: load.

EndpointType string

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

Nodes string

A list of nodes that connect to the address configuration.

ReadWriteMode string

Read-write mode:ReadWrite: readable and writable (automatic read-write separation).ReadOnly: ReadOnly.

AddressItems []GetEndpointsEndpointAddressItem

A list of endpoint addresses. Each element contains the following attributes.

AutoAddNewNodes string

Whether the new node is automatically added to the default cluster address.Options are Enable and Disable.

DbEndpointId string

endpoint of the cluster.

EndpointConfig string

The Endpoint configuration. ConsistLevel: session consistency level, value:0: final consistency,1: session consistency;LoadBalanceStrategy: load balancing strategy. Based on the automatic scheduling of load, the value is: load.

EndpointType string

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

Nodes string

A list of nodes that connect to the address configuration.

ReadWriteMode string

Read-write mode:ReadWrite: readable and writable (automatic read-write separation).ReadOnly: ReadOnly.

addressItems List<GetEndpointsEndpointAddressItem>

A list of endpoint addresses. Each element contains the following attributes.

autoAddNewNodes String

Whether the new node is automatically added to the default cluster address.Options are Enable and Disable.

dbEndpointId String

endpoint of the cluster.

endpointConfig String

The Endpoint configuration. ConsistLevel: session consistency level, value:0: final consistency,1: session consistency;LoadBalanceStrategy: load balancing strategy. Based on the automatic scheduling of load, the value is: load.

endpointType String

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

nodes String

A list of nodes that connect to the address configuration.

readWriteMode String

Read-write mode:ReadWrite: readable and writable (automatic read-write separation).ReadOnly: ReadOnly.

addressItems GetEndpointsEndpointAddressItem[]

A list of endpoint addresses. Each element contains the following attributes.

autoAddNewNodes string

Whether the new node is automatically added to the default cluster address.Options are Enable and Disable.

dbEndpointId string

endpoint of the cluster.

endpointConfig string

The Endpoint configuration. ConsistLevel: session consistency level, value:0: final consistency,1: session consistency;LoadBalanceStrategy: load balancing strategy. Based on the automatic scheduling of load, the value is: load.

endpointType string

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

nodes string

A list of nodes that connect to the address configuration.

readWriteMode string

Read-write mode:ReadWrite: readable and writable (automatic read-write separation).ReadOnly: ReadOnly.

address_items Sequence[GetEndpointsEndpointAddressItem]

A list of endpoint addresses. Each element contains the following attributes.

auto_add_new_nodes str

Whether the new node is automatically added to the default cluster address.Options are Enable and Disable.

db_endpoint_id str

endpoint of the cluster.

endpoint_config str

The Endpoint configuration. ConsistLevel: session consistency level, value:0: final consistency,1: session consistency;LoadBalanceStrategy: load balancing strategy. Based on the automatic scheduling of load, the value is: load.

endpoint_type str

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

nodes str

A list of nodes that connect to the address configuration.

read_write_mode str

Read-write mode:ReadWrite: readable and writable (automatic read-write separation).ReadOnly: ReadOnly.

addressItems List<Property Map>

A list of endpoint addresses. Each element contains the following attributes.

autoAddNewNodes String

Whether the new node is automatically added to the default cluster address.Options are Enable and Disable.

dbEndpointId String

endpoint of the cluster.

endpointConfig String

The Endpoint configuration. ConsistLevel: session consistency level, value:0: final consistency,1: session consistency;LoadBalanceStrategy: load balancing strategy. Based on the automatic scheduling of load, the value is: load.

endpointType String

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

nodes String

A list of nodes that connect to the address configuration.

readWriteMode String

Read-write mode:ReadWrite: readable and writable (automatic read-write separation).ReadOnly: ReadOnly.

GetEndpointsEndpointAddressItem

ConnectionString string

Connection instance string.

IpAddress string

The ip address of connection string.

NetType string

IP network type:Public or Private.

Port string

Intranet connection port.

VpcId string

ID of the VPC the instance belongs to.

VswitchId string

ID of the VSwitch the cluster belongs to.

ConnectionString string

Connection instance string.

IpAddress string

The ip address of connection string.

NetType string

IP network type:Public or Private.

Port string

Intranet connection port.

VpcId string

ID of the VPC the instance belongs to.

VswitchId string

ID of the VSwitch the cluster belongs to.

connectionString String

Connection instance string.

ipAddress String

The ip address of connection string.

netType String

IP network type:Public or Private.

port String

Intranet connection port.

vpcId String

ID of the VPC the instance belongs to.

vswitchId String

ID of the VSwitch the cluster belongs to.

connectionString string

Connection instance string.

ipAddress string

The ip address of connection string.

netType string

IP network type:Public or Private.

port string

Intranet connection port.

vpcId string

ID of the VPC the instance belongs to.

vswitchId string

ID of the VSwitch the cluster belongs to.

connection_string str

Connection instance string.

ip_address str

The ip address of connection string.

net_type str

IP network type:Public or Private.

port str

Intranet connection port.

vpc_id str

ID of the VPC the instance belongs to.

vswitch_id str

ID of the VSwitch the cluster belongs to.

connectionString String

Connection instance string.

ipAddress String

The ip address of connection string.

netType String

IP network type:Public or Private.

port String

Intranet connection port.

vpcId String

ID of the VPC the instance belongs to.

vswitchId String

ID of the VSwitch the cluster belongs to.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.