Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.drds.getInstances
Explore with Pulumi AI
The alicloud.drds.Instance
data source provides a collection of DRDS instances available in Alibaba Cloud account.
Filters support regular expression for the instance name, searches by tags, and other filters which are listed below.
NOTE: Available in 1.35.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const drdsInstancesDs = alicloud.drds.getInstances({
nameRegex: "drds-\\d+",
ids: ["drdsabc123456"],
});
export const firstDbInstanceId = drdsInstancesDs.then(drdsInstancesDs => drdsInstancesDs.instances?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
drds_instances_ds = alicloud.drds.get_instances(name_regex="drds-\\d+",
ids=["drdsabc123456"])
pulumi.export("firstDbInstanceId", drds_instances_ds.instances[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/drds"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
drdsInstancesDs, err := drds.GetInstances(ctx, &drds.GetInstancesArgs{
NameRegex: pulumi.StringRef("drds-\\d+"),
Ids: []string{
"drdsabc123456",
},
}, nil)
if err != nil {
return err
}
ctx.Export("firstDbInstanceId", drdsInstancesDs.Instances[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var drdsInstancesDs = AliCloud.Drds.GetInstances.Invoke(new()
{
NameRegex = "drds-\\d+",
Ids = new[]
{
"drdsabc123456",
},
});
return new Dictionary<string, object?>
{
["firstDbInstanceId"] = drdsInstancesDs.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.drds.DrdsFunctions;
import com.pulumi.alicloud.drds.inputs.GetInstancesArgs;
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 drdsInstancesDs = DrdsFunctions.getInstances(GetInstancesArgs.builder()
.nameRegex("drds-\\d+")
.ids("drdsabc123456")
.build());
ctx.export("firstDbInstanceId", drdsInstancesDs.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
}
}
variables:
drdsInstancesDs:
fn::invoke:
Function: alicloud:drds:getInstances
Arguments:
nameRegex: drds-\d+
ids:
- drdsabc123456
outputs:
firstDbInstanceId: ${drdsInstancesDs.instances[0].id}
Using getInstances
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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
def get_instances(description_regex: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(description_regex: Optional[pulumi.Input[str]] = None,
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[GetInstancesResult]
func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput
> Note: This function is named GetInstances
in the Go SDK.
public static class GetInstances
{
public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:drds/getInstances:getInstances
arguments:
# arguments dictionary
The following arguments are supported:
- Description
Regex string - A regex string to filter results by instance description.
- Ids List<string>
- A list of DRDS instance IDs.
- Name
Regex string - A regex string to filter results by instance description. It is deprecated since v1.91.0 and will be removed in a future release, please use 'description_regex' instead.
- Output
File string
- Description
Regex string - A regex string to filter results by instance description.
- Ids []string
- A list of DRDS instance IDs.
- Name
Regex string - A regex string to filter results by instance description. It is deprecated since v1.91.0 and will be removed in a future release, please use 'description_regex' instead.
- Output
File string
- description
Regex String - A regex string to filter results by instance description.
- ids List<String>
- A list of DRDS instance IDs.
- name
Regex String - A regex string to filter results by instance description. It is deprecated since v1.91.0 and will be removed in a future release, please use 'description_regex' instead.
- output
File String
- description
Regex string - A regex string to filter results by instance description.
- ids string[]
- A list of DRDS instance IDs.
- name
Regex string - A regex string to filter results by instance description. It is deprecated since v1.91.0 and will be removed in a future release, please use 'description_regex' instead.
- output
File string
- description_
regex str - A regex string to filter results by instance description.
- ids Sequence[str]
- A list of DRDS instance IDs.
- name_
regex str - A regex string to filter results by instance description. It is deprecated since v1.91.0 and will be removed in a future release, please use 'description_regex' instead.
- output_
file str
- description
Regex String - A regex string to filter results by instance description.
- ids List<String>
- A list of DRDS instance IDs.
- name
Regex String - A regex string to filter results by instance description. It is deprecated since v1.91.0 and will be removed in a future release, please use 'description_regex' instead.
- output
File String
getInstances Result
The following output properties are available:
- Descriptions List<string>
- A list of DRDS descriptions.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of DRDS instance IDs.
- Instances
List<Pulumi.
Ali Cloud. Drds. Outputs. Get Instances Instance> - A list of DRDS instances.
- Description
Regex string - Name
Regex string - Output
File string
- Descriptions []string
- A list of DRDS descriptions.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of DRDS instance IDs.
- Instances
[]Get
Instances Instance - A list of DRDS instances.
- Description
Regex string - Name
Regex string - Output
File string
- descriptions List<String>
- A list of DRDS descriptions.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of DRDS instance IDs.
- instances
List<Get
Instances Instance> - A list of DRDS instances.
- description
Regex String - name
Regex String - output
File String
- descriptions string[]
- A list of DRDS descriptions.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of DRDS instance IDs.
- instances
Get
Instances Instance[] - A list of DRDS instances.
- description
Regex string - name
Regex string - output
File string
- descriptions Sequence[str]
- A list of DRDS descriptions.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of DRDS instance IDs.
- instances
Sequence[Get
Instances Instance] - A list of DRDS instances.
- description_
regex str - name_
regex str - output_
file str
- descriptions List<String>
- A list of DRDS descriptions.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of DRDS instance IDs.
- instances List<Property Map>
- A list of DRDS instances.
- description
Regex String - name
Regex String - output
File String
Supporting Types
GetInstancesInstance
- Connection
String string - (Available in 1.196.0+) The connection string of the DRDS instance.
- Create
Time int - Creation time of the instance.
- Description string
- The DRDS instance description.
- Id string
- The ID of the DRDS instance.
- Network
Type string Classic
for public classic network orVPC
for private network.- Port string
- (Available in 1.196.0+) The connection port of the DRDS instance.
- Status string
- Status of the instance.
- Type string
- The DRDS Instance type.
- Version int
- The DRDS Instance version.
- Zone
Id string - Zone ID the instance belongs to.
- Connection
String string - (Available in 1.196.0+) The connection string of the DRDS instance.
- Create
Time int - Creation time of the instance.
- Description string
- The DRDS instance description.
- Id string
- The ID of the DRDS instance.
- Network
Type string Classic
for public classic network orVPC
for private network.- Port string
- (Available in 1.196.0+) The connection port of the DRDS instance.
- Status string
- Status of the instance.
- Type string
- The DRDS Instance type.
- Version int
- The DRDS Instance version.
- Zone
Id string - Zone ID the instance belongs to.
- connection
String String - (Available in 1.196.0+) The connection string of the DRDS instance.
- create
Time Integer - Creation time of the instance.
- description String
- The DRDS instance description.
- id String
- The ID of the DRDS instance.
- network
Type String Classic
for public classic network orVPC
for private network.- port String
- (Available in 1.196.0+) The connection port of the DRDS instance.
- status String
- Status of the instance.
- type String
- The DRDS Instance type.
- version Integer
- The DRDS Instance version.
- zone
Id String - Zone ID the instance belongs to.
- connection
String string - (Available in 1.196.0+) The connection string of the DRDS instance.
- create
Time number - Creation time of the instance.
- description string
- The DRDS instance description.
- id string
- The ID of the DRDS instance.
- network
Type string Classic
for public classic network orVPC
for private network.- port string
- (Available in 1.196.0+) The connection port of the DRDS instance.
- status string
- Status of the instance.
- type string
- The DRDS Instance type.
- version number
- The DRDS Instance version.
- zone
Id string - Zone ID the instance belongs to.
- connection_
string str - (Available in 1.196.0+) The connection string of the DRDS instance.
- create_
time int - Creation time of the instance.
- description str
- The DRDS instance description.
- id str
- The ID of the DRDS instance.
- network_
type str Classic
for public classic network orVPC
for private network.- port str
- (Available in 1.196.0+) The connection port of the DRDS instance.
- status str
- Status of the instance.
- type str
- The DRDS Instance type.
- version int
- The DRDS Instance version.
- zone_
id str - Zone ID the instance belongs to.
- connection
String String - (Available in 1.196.0+) The connection string of the DRDS instance.
- create
Time Number - Creation time of the instance.
- description String
- The DRDS instance description.
- id String
- The ID of the DRDS instance.
- network
Type String Classic
for public classic network orVPC
for private network.- port String
- (Available in 1.196.0+) The connection port of the DRDS instance.
- status String
- Status of the instance.
- type String
- The DRDS Instance type.
- version Number
- The DRDS Instance version.
- zone
Id String - Zone ID the instance 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.