1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. mns
  5. getQueues
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.mns.getQueues

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides a list of MNS queues in an Alibaba Cloud account according to the specified parameters.

    DEPRECATED: This datasource has been deprecated from version 1.188.0. Please use new datasource message_service_queues.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const queues = alicloud.mns.getQueues({
        namePrefix: "tf-",
    });
    export const firstQueueId = queues.then(queues => queues.queues?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    queues = alicloud.mns.get_queues(name_prefix="tf-")
    pulumi.export("firstQueueId", queues.queues[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mns"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		queues, err := mns.GetQueues(ctx, &mns.GetQueuesArgs{
    			NamePrefix: pulumi.StringRef("tf-"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstQueueId", queues.Queues[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var queues = AliCloud.Mns.GetQueues.Invoke(new()
        {
            NamePrefix = "tf-",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstQueueId"] = queues.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.mns.MnsFunctions;
    import com.pulumi.alicloud.mns.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 queues = MnsFunctions.getQueues(GetQueuesArgs.builder()
                .namePrefix("tf-")
                .build());
    
            ctx.export("firstQueueId", queues.applyValue(getQueuesResult -> getQueuesResult.queues()[0].id()));
        }
    }
    
    variables:
      queues:
        fn::invoke:
          Function: alicloud:mns:getQueues
          Arguments:
            namePrefix: tf-
    outputs:
      firstQueueId: ${queues.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(name_prefix: Optional[str] = None,
                   output_file: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetQueuesResult
    def get_queues_output(name_prefix: Optional[pulumi.Input[str]] = None,
                   output_file: 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:mns/getQueues:getQueues
      arguments:
        # arguments dictionary

    The following arguments are supported:

    NamePrefix string
    A string to filter resulting queues by their name prefixs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    NamePrefix string
    A string to filter resulting queues by their name prefixs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    namePrefix String
    A string to filter resulting queues by their name prefixs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    namePrefix string
    A string to filter resulting queues by their name prefixs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    name_prefix str
    A string to filter resulting queues by their name prefixs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    namePrefix String
    A string to filter resulting queues by their name prefixs.
    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.
    Names List<string>
    A list of queue names.
    Queues List<Pulumi.AliCloud.Mns.Outputs.GetQueuesQueue>
    A list of queues. Each element contains the following attributes:
    NamePrefix string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Names []string
    A list of queue names.
    Queues []GetQueuesQueue
    A list of queues. Each element contains the following attributes:
    NamePrefix string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    A list of queue names.
    queues List<GetQueuesQueue>
    A list of queues. Each element contains the following attributes:
    namePrefix String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    names string[]
    A list of queue names.
    queues GetQueuesQueue[]
    A list of queues. Each element contains the following attributes:
    namePrefix string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    names Sequence[str]
    A list of queue names.
    queues Sequence[GetQueuesQueue]
    A list of queues. Each element contains the following attributes:
    name_prefix str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    A list of queue names.
    queues List<Property Map>
    A list of queues. Each element contains the following attributes:
    namePrefix String
    outputFile String

    Supporting Types

    GetQueuesQueue

    DelaySeconds int
    This attribute defines the length of time, in seconds, after which every message sent to the queue is dequeued.
    Id string
    The id of the queue, The value is set to name.
    MaximumMessageSize int
    This indicates the maximum length, in bytes, of any message body sent to the queue.
    MessageRetentionPeriod int
    Messages are deleted from the queue after a specified length of time, whether they have been activated or not. This attribute defines the viability period, in seconds, for every message in the queue.
    Name string
    The name of the queue
    PollingWaitSeconds int
    Long polling is measured in seconds. When this attribute is set to 0, long polling is disabled. When it is not set to 0, long polling is enabled and message dequeue requests will be processed only when valid messages are received or when long polling times out.
    VisibilityTimeouts int
    Dequeued messages change from active (visible) status to inactive (invisible) status. This attribute defines the length of time, in seconds, that messages remain invisible. Messages return to active status after the set period.
    DelaySeconds int
    This attribute defines the length of time, in seconds, after which every message sent to the queue is dequeued.
    Id string
    The id of the queue, The value is set to name.
    MaximumMessageSize int
    This indicates the maximum length, in bytes, of any message body sent to the queue.
    MessageRetentionPeriod int
    Messages are deleted from the queue after a specified length of time, whether they have been activated or not. This attribute defines the viability period, in seconds, for every message in the queue.
    Name string
    The name of the queue
    PollingWaitSeconds int
    Long polling is measured in seconds. When this attribute is set to 0, long polling is disabled. When it is not set to 0, long polling is enabled and message dequeue requests will be processed only when valid messages are received or when long polling times out.
    VisibilityTimeouts int
    Dequeued messages change from active (visible) status to inactive (invisible) status. This attribute defines the length of time, in seconds, that messages remain invisible. Messages return to active status after the set period.
    delaySeconds Integer
    This attribute defines the length of time, in seconds, after which every message sent to the queue is dequeued.
    id String
    The id of the queue, The value is set to name.
    maximumMessageSize Integer
    This indicates the maximum length, in bytes, of any message body sent to the queue.
    messageRetentionPeriod Integer
    Messages are deleted from the queue after a specified length of time, whether they have been activated or not. This attribute defines the viability period, in seconds, for every message in the queue.
    name String
    The name of the queue
    pollingWaitSeconds Integer
    Long polling is measured in seconds. When this attribute is set to 0, long polling is disabled. When it is not set to 0, long polling is enabled and message dequeue requests will be processed only when valid messages are received or when long polling times out.
    visibilityTimeouts Integer
    Dequeued messages change from active (visible) status to inactive (invisible) status. This attribute defines the length of time, in seconds, that messages remain invisible. Messages return to active status after the set period.
    delaySeconds number
    This attribute defines the length of time, in seconds, after which every message sent to the queue is dequeued.
    id string
    The id of the queue, The value is set to name.
    maximumMessageSize number
    This indicates the maximum length, in bytes, of any message body sent to the queue.
    messageRetentionPeriod number
    Messages are deleted from the queue after a specified length of time, whether they have been activated or not. This attribute defines the viability period, in seconds, for every message in the queue.
    name string
    The name of the queue
    pollingWaitSeconds number
    Long polling is measured in seconds. When this attribute is set to 0, long polling is disabled. When it is not set to 0, long polling is enabled and message dequeue requests will be processed only when valid messages are received or when long polling times out.
    visibilityTimeouts number
    Dequeued messages change from active (visible) status to inactive (invisible) status. This attribute defines the length of time, in seconds, that messages remain invisible. Messages return to active status after the set period.
    delay_seconds int
    This attribute defines the length of time, in seconds, after which every message sent to the queue is dequeued.
    id str
    The id of the queue, The value is set to name.
    maximum_message_size int
    This indicates the maximum length, in bytes, of any message body sent to the queue.
    message_retention_period int
    Messages are deleted from the queue after a specified length of time, whether they have been activated or not. This attribute defines the viability period, in seconds, for every message in the queue.
    name str
    The name of the queue
    polling_wait_seconds int
    Long polling is measured in seconds. When this attribute is set to 0, long polling is disabled. When it is not set to 0, long polling is enabled and message dequeue requests will be processed only when valid messages are received or when long polling times out.
    visibility_timeouts int
    Dequeued messages change from active (visible) status to inactive (invisible) status. This attribute defines the length of time, in seconds, that messages remain invisible. Messages return to active status after the set period.
    delaySeconds Number
    This attribute defines the length of time, in seconds, after which every message sent to the queue is dequeued.
    id String
    The id of the queue, The value is set to name.
    maximumMessageSize Number
    This indicates the maximum length, in bytes, of any message body sent to the queue.
    messageRetentionPeriod Number
    Messages are deleted from the queue after a specified length of time, whether they have been activated or not. This attribute defines the viability period, in seconds, for every message in the queue.
    name String
    The name of the queue
    pollingWaitSeconds Number
    Long polling is measured in seconds. When this attribute is set to 0, long polling is disabled. When it is not set to 0, long polling is enabled and message dequeue requests will be processed only when valid messages are received or when long polling times out.
    visibilityTimeouts Number
    Dequeued messages change from active (visible) status to inactive (invisible) status. This attribute defines the length of time, in seconds, that messages remain invisible. Messages return to active status after the set period.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi