Module sqs
This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the
pulumi/pulumi-awsrepo; however, if that doesn’t turn up anything, please consult the sourceterraform-providers/terraform-provider-awsrepo.
Resources
Functions
Others
- GetQueueArgs
- GetQueueResult
- QueueArgs
- QueueEvent
- QueueEventHandler
- QueueEventSubscription
- QueueEventSubscriptionArgs
- QueuePolicyArgs
- QueuePolicyState
- QueueRecord
- QueueState
- RedrivePolicy
Resources
Resource Queue
class Queue extends CustomResourceExample Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const queue = new aws.sqs.Queue("queue", {
delaySeconds: 90,
maxMessageSize: 2048,
messageRetentionSeconds: 86400,
receiveWaitTimeSeconds: 10,
redrivePolicy: JSON.stringify({
deadLetterTargetArn: aws_sqs_queue.queue_deadletter.arn,
maxReceiveCount: 4,
}),
tags: {
Environment: "production",
},
});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,
});Server-side encryption (SSE)
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",
});constructor
new Queue(name: string, args?: QueueArgs, opts?: pulumi.CustomResourceOptions)Create a Queue resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: QueueState, opts?: pulumi.CustomResourceOptions): QueueGet an existing Queue resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is QueueReturns true if the given object is an instance of Queue. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
method onEvent
onEvent(name: string, handler: QueueEventHandler, args?: QueueEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): QueueEventSubscriptionCreates a new subscription to events fired from this Queue to the handler provided, along with options to control the behavior of the subscription.
property arn
public arn: pulumi.Output<string>;The ARN of the SQS queue
property contentBasedDeduplication
public contentBasedDeduplication: pulumi.Output<boolean | undefined>;Enables content-based deduplication for FIFO queues. For more information, see the related documentation
property delaySeconds
public delaySeconds: pulumi.Output<number | undefined>;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.
property fifoQueue
public fifoQueue: pulumi.Output<boolean | undefined>;Boolean designating a FIFO queue. If not set, it defaults to false making it standard.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property kmsDataKeyReusePeriodSeconds
public kmsDataKeyReusePeriodSeconds: pulumi.Output<number>;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).
property kmsMasterKeyId
public kmsMasterKeyId: pulumi.Output<string | undefined>;The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms.
property maxMessageSize
public maxMessageSize: pulumi.Output<number | undefined>;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).
property messageRetentionSeconds
public messageRetentionSeconds: pulumi.Output<number | undefined>;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).
property name
public name: pulumi.Output<string>;This is the human-readable name of the queue. If omitted, this provider will assign a random name.
property namePrefix
public namePrefix: pulumi.Output<string | undefined>;Creates a unique name beginning with the specified prefix. Conflicts with name.
property policy
public policy: pulumi.Output<string>;The JSON policy for the SQS queue.
property receiveWaitTimeSeconds
public receiveWaitTimeSeconds: pulumi.Output<number | undefined>;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.
property redrivePolicy
public redrivePolicy: pulumi.Output<string | undefined>;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").
property tags
public tags: pulumi.Output<{[key: string]: any} | undefined>;A map of tags to assign to the queue.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
property visibilityTimeoutSeconds
public visibilityTimeoutSeconds: pulumi.Output<number | undefined>;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.
Resource QueuePolicy
class QueuePolicy extends CustomResourceAllows you to set a policy of an SQS Queue while referencing ARN of the queue within the policy.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const queue = new aws.sqs.Queue("q", {});
const test = new aws.sqs.QueuePolicy("test", {
policy: pulumi.interpolate`{
"Version": "2012-10-17",
"Id": "sqspolicy",
"Statement": [
{
"Sid": "First",
"Effect": "Allow",
"Principal": "*",
"Action": "sqs:SendMessage",
"Resource": "${queue.arn}",
"Condition": {
"ArnEquals": {
"aws:SourceArn": "${aws_sns_topic_example.arn}"
}
}
}
]
}
`,
queueUrl: queue.id,
});constructor
new QueuePolicy(name: string, args: QueuePolicyArgs, opts?: pulumi.CustomResourceOptions)Create a QueuePolicy resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: QueuePolicyState, opts?: pulumi.CustomResourceOptions): QueuePolicyGet an existing QueuePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is QueuePolicyReturns true if the given object is an instance of QueuePolicy. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property policy
public policy: pulumi.Output<string>;The JSON policy for the SQS queue.
property queueUrl
public queueUrl: pulumi.Output<string>;The URL of the SQS Queue to which to attach the policy
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Functions
Function getQueue
getQueue(args: GetQueueArgs, opts?: pulumi.InvokeOptions): Promise<GetQueueResult>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 = pulumi.output(aws.sqs.getQueue({
name: "queue",
}, { async: true }));Others
interface GetQueueArgs
interface GetQueueArgsA collection of arguments for invoking getQueue.
property name
name: string;The name of the queue to match.
property tags
tags?: undefined | {[key: string]: any};A map of tags for the resource.
interface GetQueueResult
interface GetQueueResultA collection of values returned by getQueue.
property arn
arn: string;The Amazon Resource Name (ARN) of the queue.
property id
id: string;The provider-assigned unique ID for this managed resource.
property name
name: string;property tags
tags: {[key: string]: any};A map of tags for the resource.
property url
url: string;The URL of the queue.
interface QueueArgs
interface QueueArgsThe set of arguments for constructing a Queue resource.
property contentBasedDeduplication
contentBasedDeduplication?: pulumi.Input<boolean>;Enables content-based deduplication for FIFO queues. For more information, see the related documentation
property delaySeconds
delaySeconds?: pulumi.Input<number>;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.
property fifoQueue
fifoQueue?: pulumi.Input<boolean>;Boolean designating a FIFO queue. If not set, it defaults to false making it standard.
property kmsDataKeyReusePeriodSeconds
kmsDataKeyReusePeriodSeconds?: pulumi.Input<number>;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).
property kmsMasterKeyId
kmsMasterKeyId?: pulumi.Input<string>;The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms.
property maxMessageSize
maxMessageSize?: pulumi.Input<number>;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).
property messageRetentionSeconds
messageRetentionSeconds?: pulumi.Input<number>;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).
property name
name?: pulumi.Input<string>;This is the human-readable name of the queue. If omitted, this provider will assign a random name.
property namePrefix
namePrefix?: pulumi.Input<string>;Creates a unique name beginning with the specified prefix. Conflicts with name.
property policy
policy?: pulumi.Input<string>;The JSON policy for the SQS queue.
property receiveWaitTimeSeconds
receiveWaitTimeSeconds?: pulumi.Input<number>;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.
property redrivePolicy
redrivePolicy?: pulumi.Input<string>;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").
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the queue.
property visibilityTimeoutSeconds
visibilityTimeoutSeconds?: pulumi.Input<number>;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.
interface QueueEvent
interface QueueEventproperty Records
Records: QueueRecord[];type QueueEventHandler
type QueueEventHandler = lambda.EventHandler<QueueEvent, void>;class QueueEventSubscription
class QueueEventSubscription extends EventSubscriptionconstructor
public new QueueEventSubscription(name: string, queue: Queue, handler: QueueEventHandler, args: QueueEventSubscriptionArgs, opts: ComponentResourceOptions)method getData
protected getData(): Promise<TData>Retrieves the data produces by [initialize]. The data is immediately available in a
derived class’s constructor after the super(...) call to ComponentResource.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod initialize
protected initialize(args: Inputs): Promise<TData>Can be overridden by a subclass to asynchronously initialize data for this Component
automatically when constructed. The data will be available immediately for subclass
constructors to use. To access the data use .getData.
method isInstance
static isInstance(obj: any): obj is ComponentResourceReturns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
method registerOutputs
protected registerOutputs(outputs?: Inputs | Promise<Inputs> | Output<Inputs>): voidregisterOutputs registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.
ComponentResources can call this at the end of their constructor to indicate that they are
done creating child resources. This is not strictly necessary as this will automatically be
called after the initialize method completes.
property eventSourceMapping
public eventSourceMapping: EventSourceMapping;The underlying sns object created for the subscription.
property func
public func: LambdaFunction;property permission
public permission: Permission;property queue
public queue: Queue;property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
type QueueEventSubscriptionArgs
type QueueEventSubscriptionArgs = {
batchSize?: undefined | number;
};Arguments to control the sqs subscription.
interface QueuePolicyArgs
interface QueuePolicyArgsThe set of arguments for constructing a QueuePolicy resource.
property policy
policy: pulumi.Input<string>;The JSON policy for the SQS queue.
property queueUrl
queueUrl: pulumi.Input<string>;The URL of the SQS Queue to which to attach the policy
interface QueuePolicyState
interface QueuePolicyStateInput properties used for looking up and filtering QueuePolicy resources.
property policy
policy?: pulumi.Input<string>;The JSON policy for the SQS queue.
property queueUrl
queueUrl?: pulumi.Input<string>;The URL of the SQS Queue to which to attach the policy
interface QueueRecord
interface QueueRecordproperty attributes
attributes: {
ApproximateFirstReceiveTimestamp: string;
ApproximateReceiveCount: string;
SenderId: string;
SentTimestamp: string;
};property awsRegion
awsRegion: string;property body
body: string;property eventSource
eventSource: string;property eventSourceARN
eventSourceARN: string;property md5OfBody
md5OfBody: string;property messageAttributes
messageAttributes: Record<string, any>;property messageId
messageId: string;property receiptHandle
receiptHandle: string;interface QueueState
interface QueueStateInput properties used for looking up and filtering Queue resources.
property arn
arn?: pulumi.Input<string>;The ARN of the SQS queue
property contentBasedDeduplication
contentBasedDeduplication?: pulumi.Input<boolean>;Enables content-based deduplication for FIFO queues. For more information, see the related documentation
property delaySeconds
delaySeconds?: pulumi.Input<number>;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.
property fifoQueue
fifoQueue?: pulumi.Input<boolean>;Boolean designating a FIFO queue. If not set, it defaults to false making it standard.
property kmsDataKeyReusePeriodSeconds
kmsDataKeyReusePeriodSeconds?: pulumi.Input<number>;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).
property kmsMasterKeyId
kmsMasterKeyId?: pulumi.Input<string>;The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms.
property maxMessageSize
maxMessageSize?: pulumi.Input<number>;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).
property messageRetentionSeconds
messageRetentionSeconds?: pulumi.Input<number>;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).
property name
name?: pulumi.Input<string>;This is the human-readable name of the queue. If omitted, this provider will assign a random name.
property namePrefix
namePrefix?: pulumi.Input<string>;Creates a unique name beginning with the specified prefix. Conflicts with name.
property policy
policy?: pulumi.Input<string>;The JSON policy for the SQS queue.
property receiveWaitTimeSeconds
receiveWaitTimeSeconds?: pulumi.Input<number>;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.
property redrivePolicy
redrivePolicy?: pulumi.Input<string>;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").
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the queue.
property visibilityTimeoutSeconds
visibilityTimeoutSeconds?: pulumi.Input<number>;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.
interface RedrivePolicy
interface RedrivePolicyThe string that includes the parameters for the dead-letter queue functionality of the source queue. For more information about the redrive policy and dead-letter queues, see Using Amazon SQS Dead-Letter Queues in the Amazon Simple Queue Service Developer Guide: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html.
property deadLetterTargetArn
deadLetterTargetArn: ARN;The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of
maxReceiveCount is exceeded.
property maxReceiveCount
maxReceiveCount: number;The number of times a message is delivered to the source queue before being moved to the dead-letter queue.
Note: The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue.