Show / Hide Table of Contents

Namespace Pulumi.Aws.Sqs

Classes

GetQueue

GetQueueArgs

GetQueueResult

Queue

Example Usage

using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var queue = new Aws.Sqs.Queue("queue", new Aws.Sqs.QueueArgs
    {
        DelaySeconds = 90,
        MaxMessageSize = 2048,
        MessageRetentionSeconds = 86400,
        ReceiveWaitTimeSeconds = 10,
        RedrivePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            { "deadLetterTargetArn", aws_sqs_queue.Queue_deadletter.Arn },
            { "maxReceiveCount", 4 },
        }),
        Tags = 
        {
            { "Environment", "production" },
        },
    });
}

}

FIFO queue

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var queue = new Aws.Sqs.Queue("queue", new Aws.Sqs.QueueArgs
    {
        ContentBasedDeduplication = true,
        FifoQueue = true,
    });
}

}

Server-side encryption (SSE)

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var queue = new Aws.Sqs.Queue("queue", new Aws.Sqs.QueueArgs
    {
        KmsDataKeyReusePeriodSeconds = 300,
        KmsMasterKeyId = "alias/aws/sqs",
    });
}

}

QueueArgs

QueuePolicy

Allows you to set a policy of an SQS Queue while referencing ARN of the queue within the policy.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var queue = new Aws.Sqs.Queue("queue", new Aws.Sqs.QueueArgs
    {
    });
    var test = new Aws.Sqs.QueuePolicy("test", new Aws.Sqs.QueuePolicyArgs
    {
        Policy = queue.Arn.Apply(arn => @$"{{
""Version"": ""2012-10-17"",
""Id"": ""sqspolicy"",
""Statement"": [
{{
  ""Sid"": ""First"",
  ""Effect"": ""Allow"",
  ""Principal"": ""*"",
  ""Action"": ""sqs:SendMessage"",
  ""Resource"": ""{arn}"",
  ""Condition"": {{
    ""ArnEquals"": {{
      ""aws:SourceArn"": ""{aws_sns_topic.Example.Arn}""
    }}
  }}
}}
]
}}

"),
        QueueUrl = queue.Id,
    });
}

}

QueuePolicyArgs

QueuePolicyState

QueueState

Back to top Copyright 2016-2020, Pulumi Corporation.