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:
- Db
Cluster stringId PolarDB cluster ID.
- Db
Endpoint stringId endpoint of the cluster.
- Db
Cluster stringId PolarDB cluster ID.
- Db
Endpoint stringId endpoint of the cluster.
- db
Cluster StringId PolarDB cluster ID.
- db
Endpoint StringId endpoint of the cluster.
- db
Cluster stringId PolarDB cluster ID.
- db
Endpoint stringId endpoint of the cluster.
- db_
cluster_ strid PolarDB cluster ID.
- db_
endpoint_ strid endpoint of the cluster.
- db
Cluster StringId PolarDB cluster ID.
- db
Endpoint StringId endpoint of the cluster.
getEndpoints Result
The following output properties are available:
- Db
Cluster stringId - Endpoints
List<Pulumi.
Ali Cloud. Polar DB. Outputs. Get Endpoints Endpoint> A list of PolarDB cluster endpoints. Each element contains the following attributes:
- Id string
The provider-assigned unique ID for this managed resource.
- Db
Endpoint stringId The endpoint ID.
- Db
Cluster stringId - Endpoints
[]Get
Endpoints Endpoint A list of PolarDB cluster endpoints. Each element contains the following attributes:
- Id string
The provider-assigned unique ID for this managed resource.
- Db
Endpoint stringId The endpoint ID.
- db
Cluster StringId - endpoints
List<Get
Endpoints Endpoint> A list of PolarDB cluster endpoints. Each element contains the following attributes:
- id String
The provider-assigned unique ID for this managed resource.
- db
Endpoint StringId The endpoint ID.
- db
Cluster stringId - endpoints
Get
Endpoints Endpoint[] A list of PolarDB cluster endpoints. Each element contains the following attributes:
- id string
The provider-assigned unique ID for this managed resource.
- db
Endpoint stringId The endpoint ID.
- db_
cluster_ strid - endpoints
Sequence[Get
Endpoints Endpoint] 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_ strid The endpoint ID.
- db
Cluster StringId - 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.
- db
Endpoint StringId The endpoint ID.
Supporting Types
GetEndpointsEndpoint
- Address
Items List<Pulumi.Ali Cloud. Polar DB. Inputs. Get Endpoints Endpoint Address Item> A list of endpoint addresses. Each element contains the following attributes.
- Auto
Add stringNew Nodes Whether the new node is automatically added to the default cluster address.Options are
Enable
andDisable
.- Db
Endpoint stringId endpoint of the cluster.
- Endpoint
Config 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
.- Endpoint
Type 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.
- Read
Write stringMode Read-write mode:
ReadWrite
: readable and writable (automatic read-write separation).ReadOnly
: ReadOnly.
- Address
Items []GetEndpoints Endpoint Address Item A list of endpoint addresses. Each element contains the following attributes.
- Auto
Add stringNew Nodes Whether the new node is automatically added to the default cluster address.Options are
Enable
andDisable
.- Db
Endpoint stringId endpoint of the cluster.
- Endpoint
Config 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
.- Endpoint
Type 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.
- Read
Write stringMode Read-write mode:
ReadWrite
: readable and writable (automatic read-write separation).ReadOnly
: ReadOnly.
- address
Items List<GetEndpoints Endpoint Address Item> A list of endpoint addresses. Each element contains the following attributes.
- auto
Add StringNew Nodes Whether the new node is automatically added to the default cluster address.Options are
Enable
andDisable
.- db
Endpoint StringId endpoint of the cluster.
- endpoint
Config 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
.- endpoint
Type 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.
- read
Write StringMode Read-write mode:
ReadWrite
: readable and writable (automatic read-write separation).ReadOnly
: ReadOnly.
- address
Items GetEndpoints Endpoint Address Item[] A list of endpoint addresses. Each element contains the following attributes.
- auto
Add stringNew Nodes Whether the new node is automatically added to the default cluster address.Options are
Enable
andDisable
.- db
Endpoint stringId endpoint of the cluster.
- endpoint
Config 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
.- endpoint
Type 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.
- read
Write stringMode Read-write mode:
ReadWrite
: readable and writable (automatic read-write separation).ReadOnly
: ReadOnly.
- address_
items Sequence[GetEndpoints Endpoint Address Item] A list of endpoint addresses. Each element contains the following attributes.
- auto_
add_ strnew_ nodes Whether the new node is automatically added to the default cluster address.Options are
Enable
andDisable
.- db_
endpoint_ strid 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_ strmode Read-write mode:
ReadWrite
: readable and writable (automatic read-write separation).ReadOnly
: ReadOnly.
- address
Items List<Property Map> A list of endpoint addresses. Each element contains the following attributes.
- auto
Add StringNew Nodes Whether the new node is automatically added to the default cluster address.Options are
Enable
andDisable
.- db
Endpoint StringId endpoint of the cluster.
- endpoint
Config 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
.- endpoint
Type 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.
- read
Write StringMode Read-write mode:
ReadWrite
: readable and writable (automatic read-write separation).ReadOnly
: ReadOnly.
GetEndpointsEndpointAddressItem
- connection_
string str Connection instance string.
- ip_
address str The ip address of connection string.
- net_
type str IP network type:
Public
orPrivate
.- 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.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.