GetInstances
This data source provides a list of ONS Instances in an Alibaba Cloud account according to the specified filters.
NOTE: Available in 1.52.0+
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.Get("name") ?? "onsInstanceDatasourceName";
var @default = new AliCloud.RocketMQ.Instance("default", new AliCloud.RocketMQ.InstanceArgs
{
Remark = "default_ons_instance_remark",
});
var instancesDs = Output.Tuple(@default.Id, @default.Name).Apply(values =>
{
var id = values.Item1;
var name = values.Item2;
return AliCloud.RocketMQ.GetInstances.InvokeAsync(new AliCloud.RocketMQ.GetInstancesArgs
{
Ids =
{
id,
},
NameRegex = name,
OutputFile = "instances.txt",
});
});
this.FirstInstanceId = instancesDs.Apply(instancesDs => instancesDs.Instances[0].InstanceId);
}
[Output("firstInstanceId")]
public Output<string> FirstInstanceId { get; set; }
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "onsInstanceDatasourceName"
default = alicloud.rocketmq.Instance("default", remark="default_ons_instance_remark")
instances_ds = pulumi.Output.all(default.id, default.name).apply(lambda id, name: alicloud.rocketmq.get_instances(ids=[id],
name_regex=name,
output_file="instances.txt"))
pulumi.export("firstInstanceId", instances_ds.instances[0]["instance_id"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "onsInstanceDatasourceName";
const defaultInstance = new alicloud.rocketmq.Instance("default", {
remark: "default_ons_instance_remark",
});
const instancesDs = pulumi.all([defaultInstance.id, defaultInstance.name]).apply(([id, name]) => alicloud.rocketmq.getInstances({
ids: [id],
nameRegex: name,
outputFile: "instances.txt",
}, { async: true }));
export const firstInstanceId = instancesDs.instances[0].instanceId;Using GetInstances
function getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>function get_instances(ids=None, name_regex=None, output_file=None, opts=None)func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)public static class GetInstances {
public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Ids List<string>
A list of instance IDs to filter results.
- Name
Regex string A regex string to filter results by the instance name.
- Output
File string
- ids List[str]
A list of instance IDs to filter results.
- name_
regex str A regex string to filter results by the instance name.
- output_
file str
GetInstances Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of instance IDs.
- Instances
List<Pulumi.
Ali Cloud. Rocket MQ. Outputs. Get Instances Instance> A list of instances. Each element contains the following attributes:
- Names List<string>
A list of instance names.
- Name
Regex string - Output
File string
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
A list of instance IDs.
- instances
List[Get
Instances Instance] A list of instances. Each element contains the following attributes:
- names List[str]
A list of instance names.
- name_
regex str - output_
file str
Supporting Types
GetInstancesInstance
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Id string
ID of the instance.
- Instance
Id string ID of the instance.
- Instance
Name string Name of the instance.
- Instance
Status int The status of the instance. Read Fields in InstanceVO for further details.
- Instance
Type int The type of the instance. Read Fields in InstanceVO for further details.
- Release
Time int The automatic release time of an Enterprise Platinum Edition instance.
- Id string
ID of the instance.
- Instance
Id string ID of the instance.
- Instance
Name string Name of the instance.
- Instance
Status int The status of the instance. Read Fields in InstanceVO for further details.
- Instance
Type int The type of the instance. Read Fields in InstanceVO for further details.
- Release
Time int The automatic release time of an Enterprise Platinum Edition instance.
- id string
ID of the instance.
- instance
Id string ID of the instance.
- instance
Name string Name of the instance.
- instance
Status number The status of the instance. Read Fields in InstanceVO for further details.
- instance
Type number The type of the instance. Read Fields in InstanceVO for further details.
- release
Time number The automatic release time of an Enterprise Platinum Edition instance.
- id str
ID of the instance.
- instance_
id str ID of the instance.
- instance_
name str Name of the instance.
- instance_
status float The status of the instance. Read Fields in InstanceVO for further details.
- instance_
type float The type of the instance. Read Fields in InstanceVO for further details.
- release_
time float The automatic release time of an Enterprise Platinum Edition instance.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.