Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.amqp.getQueues
Explore with Pulumi AI
This data source provides the Amqp Queues of the current Alibaba Cloud user.
NOTE: Available in v1.127.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.amqp.getQueues({
instanceId: "amqp-abc12345",
virtualHostName: "my-VirtualHost",
ids: [
"my-Queue-1",
"my-Queue-2",
],
});
export const amqpQueueId1 = ids.then(ids => ids.queues?.[0]?.id);
const nameRegex = alicloud.amqp.getQueues({
instanceId: "amqp-abc12345",
virtualHostName: "my-VirtualHost",
nameRegex: "^my-Queue",
});
export const amqpQueueId2 = nameRegex.then(nameRegex => nameRegex.queues?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.amqp.get_queues(instance_id="amqp-abc12345",
virtual_host_name="my-VirtualHost",
ids=[
"my-Queue-1",
"my-Queue-2",
])
pulumi.export("amqpQueueId1", ids.queues[0].id)
name_regex = alicloud.amqp.get_queues(instance_id="amqp-abc12345",
virtual_host_name="my-VirtualHost",
name_regex="^my-Queue")
pulumi.export("amqpQueueId2", name_regex.queues[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/amqp"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := amqp.GetQueues(ctx, &amqp.GetQueuesArgs{
InstanceId: "amqp-abc12345",
VirtualHostName: "my-VirtualHost",
Ids: []string{
"my-Queue-1",
"my-Queue-2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("amqpQueueId1", ids.Queues[0].Id)
nameRegex, err := amqp.GetQueues(ctx, &amqp.GetQueuesArgs{
InstanceId: "amqp-abc12345",
VirtualHostName: "my-VirtualHost",
NameRegex: pulumi.StringRef("^my-Queue"),
}, nil)
if err != nil {
return err
}
ctx.Export("amqpQueueId2", nameRegex.Queues[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Amqp.GetQueues.Invoke(new()
{
InstanceId = "amqp-abc12345",
VirtualHostName = "my-VirtualHost",
Ids = new[]
{
"my-Queue-1",
"my-Queue-2",
},
});
var nameRegex = AliCloud.Amqp.GetQueues.Invoke(new()
{
InstanceId = "amqp-abc12345",
VirtualHostName = "my-VirtualHost",
NameRegex = "^my-Queue",
});
return new Dictionary<string, object?>
{
["amqpQueueId1"] = ids.Apply(getQueuesResult => getQueuesResult.Queues[0]?.Id),
["amqpQueueId2"] = nameRegex.Apply(getQueuesResult => getQueuesResult.Queues[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.amqp.AmqpFunctions;
import com.pulumi.alicloud.amqp.inputs.GetQueuesArgs;
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 = AmqpFunctions.getQueues(GetQueuesArgs.builder()
.instanceId("amqp-abc12345")
.virtualHostName("my-VirtualHost")
.ids(
"my-Queue-1",
"my-Queue-2")
.build());
ctx.export("amqpQueueId1", ids.applyValue(getQueuesResult -> getQueuesResult.queues()[0].id()));
final var nameRegex = AmqpFunctions.getQueues(GetQueuesArgs.builder()
.instanceId("amqp-abc12345")
.virtualHostName("my-VirtualHost")
.nameRegex("^my-Queue")
.build());
ctx.export("amqpQueueId2", nameRegex.applyValue(getQueuesResult -> getQueuesResult.queues()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:amqp:getQueues
Arguments:
instanceId: amqp-abc12345
virtualHostName: my-VirtualHost
ids:
- my-Queue-1
- my-Queue-2
nameRegex:
fn::invoke:
Function: alicloud:amqp:getQueues
Arguments:
instanceId: amqp-abc12345
virtualHostName: my-VirtualHost
nameRegex: ^my-Queue
outputs:
amqpQueueId1: ${ids.queues[0].id}
amqpQueueId2: ${nameRegex.queues[0].id}
Using getQueues
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 getQueues(args: GetQueuesArgs, opts?: InvokeOptions): Promise<GetQueuesResult>
function getQueuesOutput(args: GetQueuesOutputArgs, opts?: InvokeOptions): Output<GetQueuesResult>
def get_queues(ids: Optional[Sequence[str]] = None,
instance_id: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
virtual_host_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetQueuesResult
def get_queues_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
instance_id: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
virtual_host_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetQueuesResult]
func GetQueues(ctx *Context, args *GetQueuesArgs, opts ...InvokeOption) (*GetQueuesResult, error)
func GetQueuesOutput(ctx *Context, args *GetQueuesOutputArgs, opts ...InvokeOption) GetQueuesResultOutput
> Note: This function is named GetQueues
in the Go SDK.
public static class GetQueues
{
public static Task<GetQueuesResult> InvokeAsync(GetQueuesArgs args, InvokeOptions? opts = null)
public static Output<GetQueuesResult> Invoke(GetQueuesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetQueuesResult> getQueues(GetQueuesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:amqp/getQueues:getQueues
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Id string - The ID of the instance.
- Virtual
Host stringName - The name of the virtual host.
- Ids List<string>
- A list of Queue IDs. Its element value is same as Queue Name.
- Name
Regex string - A regex string to filter results by Queue name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Instance
Id string - The ID of the instance.
- Virtual
Host stringName - The name of the virtual host.
- Ids []string
- A list of Queue IDs. Its element value is same as Queue Name.
- Name
Regex string - A regex string to filter results by Queue name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- instance
Id String - The ID of the instance.
- virtual
Host StringName - The name of the virtual host.
- ids List<String>
- A list of Queue IDs. Its element value is same as Queue Name.
- name
Regex String - A regex string to filter results by Queue name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- instance
Id string - The ID of the instance.
- virtual
Host stringName - The name of the virtual host.
- ids string[]
- A list of Queue IDs. Its element value is same as Queue Name.
- name
Regex string - A regex string to filter results by Queue name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- instance_
id str - The ID of the instance.
- virtual_
host_ strname - The name of the virtual host.
- ids Sequence[str]
- A list of Queue IDs. Its element value is same as Queue Name.
- name_
regex str - A regex string to filter results by Queue name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- instance
Id String - The ID of the instance.
- virtual
Host StringName - The name of the virtual host.
- ids List<String>
- A list of Queue IDs. Its element value is same as Queue Name.
- name
Regex String - A regex string to filter results by Queue name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getQueues Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Instance
Id string - Names List<string>
- Queues
List<Pulumi.
Ali Cloud. Amqp. Outputs. Get Queues Queue> - Virtual
Host stringName - Name
Regex string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Instance
Id string - Names []string
- Queues
[]Get
Queues Queue - Virtual
Host stringName - Name
Regex string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- instance
Id String - names List<String>
- queues
List<Get
Queues Queue> - virtual
Host StringName - name
Regex String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- instance
Id string - names string[]
- queues
Get
Queues Queue[] - virtual
Host stringName - name
Regex string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- instance_
id str - names Sequence[str]
- queues
Sequence[Get
Queues Queue] - virtual_
host_ strname - name_
regex str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- instance
Id String - names List<String>
- queues List<Property Map>
- virtual
Host StringName - name
Regex String - output
File String
Supporting Types
GetQueuesQueue
- Attributes Dictionary<string, object>
- The attributes for the Queue.
- Auto
Delete boolState - Specifies whether the Auto Delete attribute is configured.
- Create
Time string - CreateTime.
- Exclusive
State bool - Specifies whether the queue is an exclusive queue.
- Id string
- The ID of the Queue. Its value is same as Queue Name.
- Instance
Id string - The ID of the instance.
- Last
Consume stringTime - The last consume time.
- Queue
Name string - The queue name.
- Virtual
Host stringName - The name of the virtual host.
- Attributes map[string]interface{}
- The attributes for the Queue.
- Auto
Delete boolState - Specifies whether the Auto Delete attribute is configured.
- Create
Time string - CreateTime.
- Exclusive
State bool - Specifies whether the queue is an exclusive queue.
- Id string
- The ID of the Queue. Its value is same as Queue Name.
- Instance
Id string - The ID of the instance.
- Last
Consume stringTime - The last consume time.
- Queue
Name string - The queue name.
- Virtual
Host stringName - The name of the virtual host.
- attributes Map<String,Object>
- The attributes for the Queue.
- auto
Delete BooleanState - Specifies whether the Auto Delete attribute is configured.
- create
Time String - CreateTime.
- exclusive
State Boolean - Specifies whether the queue is an exclusive queue.
- id String
- The ID of the Queue. Its value is same as Queue Name.
- instance
Id String - The ID of the instance.
- last
Consume StringTime - The last consume time.
- queue
Name String - The queue name.
- virtual
Host StringName - The name of the virtual host.
- attributes {[key: string]: any}
- The attributes for the Queue.
- auto
Delete booleanState - Specifies whether the Auto Delete attribute is configured.
- create
Time string - CreateTime.
- exclusive
State boolean - Specifies whether the queue is an exclusive queue.
- id string
- The ID of the Queue. Its value is same as Queue Name.
- instance
Id string - The ID of the instance.
- last
Consume stringTime - The last consume time.
- queue
Name string - The queue name.
- virtual
Host stringName - The name of the virtual host.
- attributes Mapping[str, Any]
- The attributes for the Queue.
- auto_
delete_ boolstate - Specifies whether the Auto Delete attribute is configured.
- create_
time str - CreateTime.
- exclusive_
state bool - Specifies whether the queue is an exclusive queue.
- id str
- The ID of the Queue. Its value is same as Queue Name.
- instance_
id str - The ID of the instance.
- last_
consume_ strtime - The last consume time.
- queue_
name str - The queue name.
- virtual_
host_ strname - The name of the virtual host.
- attributes Map<Any>
- The attributes for the Queue.
- auto
Delete BooleanState - Specifies whether the Auto Delete attribute is configured.
- create
Time String - CreateTime.
- exclusive
State Boolean - Specifies whether the queue is an exclusive queue.
- id String
- The ID of the Queue. Its value is same as Queue Name.
- instance
Id String - The ID of the instance.
- last
Consume StringTime - The last consume time.
- queue
Name String - The queue name.
- virtual
Host StringName - The name of the virtual host.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.