AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

getQueue

Use this data source to get the ARN and URL of queue in AWS Simple Queue Service (SQS). By using this data source, you can reference SQS queues without having to hardcode the ARNs as input.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Sqs.GetQueue.InvokeAsync(new Aws.Sqs.GetQueueArgs
        {
            Name = "queue",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/sqs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sqs.LookupQueue(ctx, &sqs.LookupQueueArgs{
			Name: "queue",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(SqsFunctions.getQueue(GetQueueArgs.builder()
            .name("queue")
            .build()));

        }
}
import pulumi
import pulumi_aws as aws

example = aws.sqs.get_queue(name="queue")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.sqs.getQueue({
    name: "queue",
}));
variables:
  example:
    Fn::Invoke:
      Function: aws:sqs:getQueue
      Arguments:
        name: queue

Using getQueue

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 getQueue(args: GetQueueArgs, opts?: InvokeOptions): Promise<GetQueueResult>
function getQueueOutput(args: GetQueueOutputArgs, opts?: InvokeOptions): Output<GetQueueResult>
def get_queue(name: Optional[str] = None,
              tags: Optional[Mapping[str, str]] = None,
              opts: Optional[InvokeOptions] = None) -> GetQueueResult
def get_queue_output(name: Optional[pulumi.Input[str]] = None,
              tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetQueueResult]
func LookupQueue(ctx *Context, args *LookupQueueArgs, opts ...InvokeOption) (*LookupQueueResult, error)
func LookupQueueOutput(ctx *Context, args *LookupQueueOutputArgs, opts ...InvokeOption) LookupQueueResultOutput

> Note: This function is named LookupQueue in the Go SDK.

public static class GetQueue 
{
    public static Task<GetQueueResult> InvokeAsync(GetQueueArgs args, InvokeOptions? opts = null)
    public static Output<GetQueueResult> Invoke(GetQueueInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetQueueResult> getQueue(GetQueueArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:sqs/getQueue:getQueue
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

The name of the queue to match.

Tags Dictionary<string, string>

A map of tags for the resource.

Name string

The name of the queue to match.

Tags map[string]string

A map of tags for the resource.

name String

The name of the queue to match.

tags Map

A map of tags for the resource.

name string

The name of the queue to match.

tags {[key: string]: string}

A map of tags for the resource.

name str

The name of the queue to match.

tags Mapping[str, str]

A map of tags for the resource.

name String

The name of the queue to match.

tags Map

A map of tags for the resource.

getQueue Result

The following output properties are available:

Arn string

The Amazon Resource Name (ARN) of the queue.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Tags Dictionary<string, string>

A map of tags for the resource.

Url string

The URL of the queue.

Arn string

The Amazon Resource Name (ARN) of the queue.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Tags map[string]string

A map of tags for the resource.

Url string

The URL of the queue.

arn String

The Amazon Resource Name (ARN) of the queue.

id String

The provider-assigned unique ID for this managed resource.

name String
tags Map

A map of tags for the resource.

url String

The URL of the queue.

arn string

The Amazon Resource Name (ARN) of the queue.

id string

The provider-assigned unique ID for this managed resource.

name string
tags {[key: string]: string}

A map of tags for the resource.

url string

The URL of the queue.

arn str

The Amazon Resource Name (ARN) of the queue.

id str

The provider-assigned unique ID for this managed resource.

name str
tags Mapping[str, str]

A map of tags for the resource.

url str

The URL of the queue.

arn String

The Amazon Resource Name (ARN) of the queue.

id String

The provider-assigned unique ID for this managed resource.

name String
tags Map

A map of tags for the resource.

url String

The URL of the queue.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.