AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
aws.sqs.getQueue
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.sqs.getQueue({
name: "queue",
});
import pulumi
import pulumi_aws as aws
example = aws.sqs.get_queue(name="queue")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Sqs.GetQueue.Invoke(new()
{
Name = "queue",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sqs.SqsFunctions;
import com.pulumi.aws.sqs.inputs.GetQueueArgs;
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 example = SqsFunctions.getQueue(GetQueueArgs.builder()
.name("queue")
.build());
}
}
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
- Name of the queue to match.
- Dictionary<string, string>
- Map of tags for the resource.
- Name string
- Name of the queue to match.
- map[string]string
- Map of tags for the resource.
- name String
- Name of the queue to match.
- Map<String,String>
- Map of tags for the resource.
- name string
- Name of the queue to match.
- {[key: string]: string}
- Map of tags for the resource.
- name str
- Name of the queue to match.
- Mapping[str, str]
- Map of tags for the resource.
- name String
- Name of the queue to match.
- Map<String>
- Map of tags for the resource.
getQueue Result
The following output properties are available:
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.