1. Packages
  2. Alicloud Provider
  3. API Docs
  4. amqp
  5. getQueues
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

alicloud.amqp.getQueues

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

    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:

    InstanceId string
    The ID of the instance.
    VirtualHostName string
    The name of the virtual host.
    Ids List<string>
    A list of Queue IDs. Its element value is same as Queue Name.
    NameRegex string
    A regex string to filter results by Queue name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    InstanceId string
    The ID of the instance.
    VirtualHostName string
    The name of the virtual host.
    Ids []string
    A list of Queue IDs. Its element value is same as Queue Name.
    NameRegex string
    A regex string to filter results by Queue name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    instanceId String
    The ID of the instance.
    virtualHostName String
    The name of the virtual host.
    ids List<String>
    A list of Queue IDs. Its element value is same as Queue Name.
    nameRegex String
    A regex string to filter results by Queue name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    instanceId string
    The ID of the instance.
    virtualHostName string
    The name of the virtual host.
    ids string[]
    A list of Queue IDs. Its element value is same as Queue Name.
    nameRegex string
    A regex string to filter results by Queue name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    instance_id str
    The ID of the instance.
    virtual_host_name str
    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).
    instanceId String
    The ID of the instance.
    virtualHostName String
    The name of the virtual host.
    ids List<String>
    A list of Queue IDs. Its element value is same as Queue Name.
    nameRegex String
    A regex string to filter results by Queue name.
    outputFile 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>
    InstanceId string
    Names List<string>
    Queues List<Pulumi.AliCloud.Amqp.Outputs.GetQueuesQueue>
    VirtualHostName string
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    InstanceId string
    Names []string
    Queues []GetQueuesQueue
    VirtualHostName string
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    names List<String>
    queues List<GetQueuesQueue>
    virtualHostName String
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instanceId string
    names string[]
    queues GetQueuesQueue[]
    virtualHostName string
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instance_id str
    names Sequence[str]
    queues Sequence[GetQueuesQueue]
    virtual_host_name str
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instanceId String
    names List<String>
    queues List<Property Map>
    virtualHostName String
    nameRegex String
    outputFile String

    Supporting Types

    GetQueuesQueue

    Attributes Dictionary<string, string>
    The attributes for the Queue.
    AutoDeleteState bool
    Specifies whether the Auto Delete attribute is configured.
    CreateTime string
    CreateTime.
    ExclusiveState bool
    Specifies whether the queue is an exclusive queue.
    Id string
    The ID of the Queue. Its value is same as Queue Name.
    InstanceId string
    The ID of the instance.
    LastConsumeTime string
    The last consume time.
    QueueName string
    The queue name.
    VirtualHostName string
    The name of the virtual host.
    Attributes map[string]string
    The attributes for the Queue.
    AutoDeleteState bool
    Specifies whether the Auto Delete attribute is configured.
    CreateTime string
    CreateTime.
    ExclusiveState bool
    Specifies whether the queue is an exclusive queue.
    Id string
    The ID of the Queue. Its value is same as Queue Name.
    InstanceId string
    The ID of the instance.
    LastConsumeTime string
    The last consume time.
    QueueName string
    The queue name.
    VirtualHostName string
    The name of the virtual host.
    attributes Map<String,String>
    The attributes for the Queue.
    autoDeleteState Boolean
    Specifies whether the Auto Delete attribute is configured.
    createTime String
    CreateTime.
    exclusiveState Boolean
    Specifies whether the queue is an exclusive queue.
    id String
    The ID of the Queue. Its value is same as Queue Name.
    instanceId String
    The ID of the instance.
    lastConsumeTime String
    The last consume time.
    queueName String
    The queue name.
    virtualHostName String
    The name of the virtual host.
    attributes {[key: string]: string}
    The attributes for the Queue.
    autoDeleteState boolean
    Specifies whether the Auto Delete attribute is configured.
    createTime string
    CreateTime.
    exclusiveState boolean
    Specifies whether the queue is an exclusive queue.
    id string
    The ID of the Queue. Its value is same as Queue Name.
    instanceId string
    The ID of the instance.
    lastConsumeTime string
    The last consume time.
    queueName string
    The queue name.
    virtualHostName string
    The name of the virtual host.
    attributes Mapping[str, str]
    The attributes for the Queue.
    auto_delete_state bool
    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_time str
    The last consume time.
    queue_name str
    The queue name.
    virtual_host_name str
    The name of the virtual host.
    attributes Map<String>
    The attributes for the Queue.
    autoDeleteState Boolean
    Specifies whether the Auto Delete attribute is configured.
    createTime String
    CreateTime.
    exclusiveState Boolean
    Specifies whether the queue is an exclusive queue.
    id String
    The ID of the Queue. Its value is same as Queue Name.
    instanceId String
    The ID of the instance.
    lastConsumeTime String
    The last consume time.
    queueName String
    The queue name.
    virtualHostName String
    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.
    alicloud logo
    Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi