QueueArgs

data class QueueArgs(val contentBasedDeduplication: Output<Boolean>? = null, val deduplicationScope: Output<String>? = null, val delaySeconds: Output<Int>? = null, val fifoQueue: Output<Boolean>? = null, val fifoThroughputLimit: Output<String>? = null, val kmsDataKeyReusePeriodSeconds: Output<Int>? = null, val kmsMasterKeyId: Output<String>? = null, val maxMessageSize: Output<Int>? = null, val messageRetentionSeconds: Output<Int>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val policy: Output<String>? = null, val receiveWaitTimeSeconds: Output<Int>? = null, val redriveAllowPolicy: Output<String>? = null, val redrivePolicy: Output<String>? = null, val sqsManagedSseEnabled: Output<Boolean>? = null, val tags: Output<Map<String, String>>? = null, val visibilityTimeoutSeconds: Output<Int>? = null) : ConvertibleToJava<QueueArgs>

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sqs.Queue;
import com.pulumi.aws.sqs.QueueArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
var queue = new Queue("queue", QueueArgs.builder()
.delaySeconds(90)
.maxMessageSize(2048)
.messageRetentionSeconds(86400)
.receiveWaitTimeSeconds(10)
.redrivePolicy(serializeJson(
jsonObject(
jsonProperty("deadLetterTargetArn", aws_sqs_queue.queue_deadletter().arn()),
jsonProperty("maxReceiveCount", 4)
)))
.tags(Map.of("Environment", "production"))
.build());
}
}

FIFO queue

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const queue = new aws.sqs.Queue("queue", {
contentBasedDeduplication: true,
fifoQueue: true,
});
import pulumi
import pulumi_aws as aws
queue = aws.sqs.Queue("queue",
content_based_deduplication=True,
fifo_queue=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var queue = new Aws.Sqs.Queue("queue", new()
{
ContentBasedDeduplication = true,
FifoQueue = true,
});
});
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.NewQueue(ctx, "queue", &sqs.QueueArgs{
ContentBasedDeduplication: pulumi.Bool(true),
FifoQueue: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sqs.Queue;
import com.pulumi.aws.sqs.QueueArgs;
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) {
var queue = new Queue("queue", QueueArgs.builder()
.contentBasedDeduplication(true)
.fifoQueue(true)
.build());
}
}
resources:
queue:
type: aws:sqs:Queue
properties:
contentBasedDeduplication: true
fifoQueue: true

High-throughput FIFO queue

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const queue = new aws.sqs.Queue("queue", {
deduplicationScope: "messageGroup",
fifoQueue: true,
fifoThroughputLimit: "perMessageGroupId",
});
import pulumi
import pulumi_aws as aws
queue = aws.sqs.Queue("queue",
deduplication_scope="messageGroup",
fifo_queue=True,
fifo_throughput_limit="perMessageGroupId")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var queue = new Aws.Sqs.Queue("queue", new()
{
DeduplicationScope = "messageGroup",
FifoQueue = true,
FifoThroughputLimit = "perMessageGroupId",
});
});
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.NewQueue(ctx, "queue", &sqs.QueueArgs{
DeduplicationScope: pulumi.String("messageGroup"),
FifoQueue: pulumi.Bool(true),
FifoThroughputLimit: pulumi.String("perMessageGroupId"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sqs.Queue;
import com.pulumi.aws.sqs.QueueArgs;
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) {
var queue = new Queue("queue", QueueArgs.builder()
.deduplicationScope("messageGroup")
.fifoQueue(true)
.fifoThroughputLimit("perMessageGroupId")
.build());
}
}
resources:
queue:
type: aws:sqs:Queue
properties:
deduplicationScope: messageGroup
fifoQueue: true
fifoThroughputLimit: perMessageGroupId

Dead-letter queue

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleQueueDeadletter = new aws.sqs.Queue("exampleQueueDeadletter", {redriveAllowPolicy: JSON.stringify({
redrivePermission: "byQueue",
sourceQueueArns: [aws_sqs_queue&#46;example_queue&#46;arn],
})});
import pulumi
import json
import pulumi_aws as aws
example_queue_deadletter = aws.sqs.Queue("exampleQueueDeadletter", redrive_allow_policy=json.dumps({
"redrivePermission": "byQueue",
"sourceQueueArns": [aws_sqs_queue["example_queue"]["arn"]],
}))
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var exampleQueueDeadletter = new Aws.Sqs.Queue("exampleQueueDeadletter", new()
{
RedriveAllowPolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["redrivePermission"] = "byQueue",
["sourceQueueArns"] = new[]
{
aws_sqs_queue.Example_queue.Arn,
},
}),
});
});
package main
import (
"encoding/json"
"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 {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"redrivePermission": "byQueue",
"sourceQueueArns": []interface{}{
aws_sqs_queue.Example_queue.Arn,
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = sqs.NewQueue(ctx, "exampleQueueDeadletter", &sqs.QueueArgs{
RedriveAllowPolicy: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sqs.Queue;
import com.pulumi.aws.sqs.QueueArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
var exampleQueueDeadletter = new Queue("exampleQueueDeadletter", QueueArgs.builder()
.redriveAllowPolicy(serializeJson(
jsonObject(
jsonProperty("redrivePermission", "byQueue"),
jsonProperty("sourceQueueArns", jsonArray(aws_sqs_queue.example_queue().arn()))
)))
.build());
}
}
resources:
exampleQueueDeadletter:
type: aws:sqs:Queue
properties:
redriveAllowPolicy:
fn::toJSON:
redrivePermission: byQueue
sourceQueueArns:
- ${aws_sqs_queue.example_queue.arn}

Server-side encryption (SSE)

Using SSE-SQS:

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const queue = new aws.sqs.Queue("queue", {sqsManagedSseEnabled: true});
import pulumi
import pulumi_aws as aws
queue = aws.sqs.Queue("queue", sqs_managed_sse_enabled=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var queue = new Aws.Sqs.Queue("queue", new()
{
SqsManagedSseEnabled = true,
});
});
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.NewQueue(ctx, "queue", &sqs.QueueArgs{
SqsManagedSseEnabled: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sqs.Queue;
import com.pulumi.aws.sqs.QueueArgs;
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) {
var queue = new Queue("queue", QueueArgs.builder()
.sqsManagedSseEnabled(true)
.build());
}
}
resources:
queue:
type: aws:sqs:Queue
properties:
sqsManagedSseEnabled: true

Using SSE-KMS:

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const queue = new aws.sqs.Queue("queue", {
kmsDataKeyReusePeriodSeconds: 300,
kmsMasterKeyId: "alias/aws/sqs",
});
import pulumi
import pulumi_aws as aws
queue = aws.sqs.Queue("queue",
kms_data_key_reuse_period_seconds=300,
kms_master_key_id="alias/aws/sqs")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var queue = new Aws.Sqs.Queue("queue", new()
{
KmsDataKeyReusePeriodSeconds = 300,
KmsMasterKeyId = "alias/aws/sqs",
});
});
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.NewQueue(ctx, "queue", &sqs.QueueArgs{
KmsDataKeyReusePeriodSeconds: pulumi.Int(300),
KmsMasterKeyId: pulumi.String("alias/aws/sqs"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sqs.Queue;
import com.pulumi.aws.sqs.QueueArgs;
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) {
var queue = new Queue("queue", QueueArgs.builder()
.kmsDataKeyReusePeriodSeconds(300)
.kmsMasterKeyId("alias/aws/sqs")
.build());
}
}
resources:
queue:
type: aws:sqs:Queue
properties:
kmsDataKeyReusePeriodSeconds: 300
kmsMasterKeyId: alias/aws/sqs

Import

SQS Queues can be imported using the queue url, e.g.,

$ pulumi import aws:sqs/queue:Queue public_queue https://queue.amazonaws.com/80398EXAMPLE/MyQueue

Constructors

Link copied to clipboard
constructor(contentBasedDeduplication: Output<Boolean>? = null, deduplicationScope: Output<String>? = null, delaySeconds: Output<Int>? = null, fifoQueue: Output<Boolean>? = null, fifoThroughputLimit: Output<String>? = null, kmsDataKeyReusePeriodSeconds: Output<Int>? = null, kmsMasterKeyId: Output<String>? = null, maxMessageSize: Output<Int>? = null, messageRetentionSeconds: Output<Int>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, policy: Output<String>? = null, receiveWaitTimeSeconds: Output<Int>? = null, redriveAllowPolicy: Output<String>? = null, redrivePolicy: Output<String>? = null, sqsManagedSseEnabled: Output<Boolean>? = null, tags: Output<Map<String, String>>? = null, visibilityTimeoutSeconds: Output<Int>? = null)

Properties

Link copied to clipboard
val contentBasedDeduplication: Output<Boolean>? = null

Enables content-based deduplication for FIFO queues. For more information, see the related documentation

Link copied to clipboard
val deduplicationScope: Output<String>? = null

Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).

Link copied to clipboard
val delaySeconds: Output<Int>? = null

The time in seconds that the delivery of all messages in the queue will be delayed. An integer from 0 to 900 (15 minutes). The default for this attribute is 0 seconds.

Link copied to clipboard
val fifoQueue: Output<Boolean>? = null

Boolean designating a FIFO queue. If not set, it defaults to false making it standard.

Link copied to clipboard
val fifoThroughputLimit: Output<String>? = null

Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.

Link copied to clipboard
val kmsDataKeyReusePeriodSeconds: Output<Int>? = null

The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). The default is 300 (5 minutes).

Link copied to clipboard
val kmsMasterKeyId: Output<String>? = null

The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms.

Link copied to clipboard
val maxMessageSize: Output<Int>? = null

The limit of how many bytes a message can contain before Amazon SQS rejects it. An integer from 1024 bytes (1 KiB) up to 262144 bytes (256 KiB). The default for this attribute is 262144 (256 KiB).

Link copied to clipboard
val messageRetentionSeconds: Output<Int>? = null

The number of seconds Amazon SQS retains a message. Integer representing seconds, from 60 (1 minute) to 1209600 (14 days). The default for this attribute is 345600 (4 days).

Link copied to clipboard
val name: Output<String>? = null

The name of the queue. Queue names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 80 characters long. For a FIFO (first-in-first-out) queue, the name must end with the .fifo suffix. If omitted, this provider will assign a random, unique name. Conflicts with name_prefix

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with name

Link copied to clipboard
val policy: Output<String>? = null

The JSON policy for the SQS queue.

Link copied to clipboard
val receiveWaitTimeSeconds: Output<Int>? = null

The time for which a ReceiveMessage call will wait for a message to arrive (long polling) before returning. An integer from 0 to 20 (seconds). The default for this attribute is 0, meaning that the call will return immediately.

Link copied to clipboard
val redriveAllowPolicy: Output<String>? = null

The JSON policy to set up the Dead Letter Queue redrive permission, see AWS docs.

Link copied to clipboard
val redrivePolicy: Output<String>? = null

The JSON policy to set up the Dead Letter Queue, see AWS docs. Note: when specifying maxReceiveCount, you must specify it as an integer (5), and not a string ("5").

Link copied to clipboard
val sqsManagedSseEnabled: Output<Boolean>? = null

Boolean to enable server-side encryption (SSE) of message content with SQS-owned encryption keys. See Encryption at rest. The provider will only perform drift detection of its value when present in a configuration.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the queue. If configured with a provider default_tags configuration block) present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val visibilityTimeoutSeconds: Output<Int>? = null

The visibility timeout for the queue. An integer from 0 to 43200 (12 hours). The default for this attribute is 30. For more information about visibility timeout, see AWS docs.

Functions

Link copied to clipboard
open override fun toJava(): QueueArgs