SQS · Data

SQSQueue

Manage queues, delivery behavior, encryption, and dead letters.

Generic driverUniform lifecycle
Scope
Regional
Spec fields
16
Outputs
3
Lookup
Supported

Resource definition

What this resource looks like

This is the CUE shape a Praxis template uses to declare a SQSQueue. The resource key is local to the template; metadata.name supplies its stable Praxis identity.

CUE example
resources: {
  dlq: {
  	apiVersion: "praxis.io/alpha"
  	kind:       "SQSQueue"
  	metadata: name: "\(_naming.prefix)-dlq"
  	spec: {
  		region:                   _naming.region
  		queueName:              "\(_naming.prefix)-dlq"
  		messageRetentionPeriod: 1209600 // 14 days
  		visibilityTimeout:      300
  		tags: #StandardTags & {purpose: "dead-letter-queue"}
  	}
  }
}

Excerpted from examples/stacks/end-to-end.cue. Open the complete example for its variables and related resources.

Complete examples in the repository

Desired state

Configuration

The spec block accepts 16 fields. 3 are required by the schema; fields with defaults can be omitted.

regionRequired

Region.

string
String
queueNameRequired

Queue Name.

string & =~"^[a-zA-Z0-9_-]{1,80}(\\.fifo)?$"
String
fifoQueueOptional

Fifo Queue.

bool | *false
BooleanDefault false
visibilityTimeoutOptional

Visibility Timeout.

int & >=0 & <=43200 | *30
IntegerDefault 30
messageRetentionPeriodOptional

Message Retention Period.

int & >=60 & <=1209600 | *345600
IntegerDefault 345600
maximumMessageSizeOptional

Maximum Message Size.

int & >=1024 & <=262144 | *262144
IntegerDefault 262144
delaySecondsOptional

Delay Seconds.

int & >=0 & <=900 | *0
IntegerDefault 0
receiveMessageWaitTimeSecondsOptional

Receive Message Wait Time Seconds.

int & >=0 & <=20 | *0
IntegerDefault 0
redrivePolicyOptional

Redrive Policy.

{ deadLetterTargetArn: string maxReceiveCount: int & >=1 & <=1000 }
Object
sqsManagedSseEnabledOptional

Sqs Managed SSE Enabled.

bool | *true
BooleanDefault true
kmsMasterKeyIdOptional

Kms Master Key ID.

string
String
kmsDataKeyReusePeriodSecondsOptional

Kms Data Key Reuse Period Seconds.

int & >=60 & <=86400 | *300
IntegerDefault 300
contentBasedDeduplicationOptional

Content Based Deduplication.

bool | *false
BooleanDefault false
deduplicationScopeOptional

Deduplication Scope.

"queue" | "messageGroup"
Enum
fifoThroughputLimitOptional

Fifo Throughput Limit.

"perQueue" | "perMessageGroupId"
Enum
tagsRequired

Tags.

[string]: string
Map

Observed values

Outputs

Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.

queueUrlString
queueArnString
queueNameString

Read without ownership

Data-source lookup

A data block reads an existing SQSQueue and exposes its outputs without storing lifecycle state. The generic filter surface accepts id, name, and tag; supported combinations depend on the AWS identity used by this resource.

CUE data source
data: existing: {
  kind: "SQSQueue"
  region: "us-west-2"
  filter: {
    name: "replace-with-provider-name"
  }
}

Understand data sources and filters →

Adopt existing infrastructure

Import

Import persists Praxis state for an existing AWS resource. For this kind, supply: Provider identifier for the existing SQSQueue. The example starts in observed mode so Praxis reports drift without correcting it.

CLI
praxis import SQSQueue \
  --id <provider-identifier> \
  --region us-west-2 \
  --account production \
  --observe

Choose managed or observed ownership →

Canonical contract

Complete CUE schema

The field guide above is derived from this definition. The schema remains the source of truth for accepted values, defaults, validation constraints, and outputs in the current alpha revision.

Show the complete schema
schemas/aws/sqs/queue.cue
package sqs

#SQSQueue: {
	apiVersion: "praxis.io/alpha"
	kind:       "SQSQueue"

	metadata: {
		name: string & =~"^[a-zA-Z0-9][a-zA-Z0-9._-]{0,79}$"
		labels: [string]: string
	}

	spec: {
		region:                        string
		queueName:                     string & =~"^[a-zA-Z0-9_-]{1,80}(\\.fifo)?$"
		fifoQueue:                     bool | *false
		visibilityTimeout:             int & >=0 & <=43200 | *30
		messageRetentionPeriod:        int & >=60 & <=1209600 | *345600
		maximumMessageSize:            int & >=1024 & <=262144 | *262144
		delaySeconds:                  int & >=0 & <=900 | *0
		receiveMessageWaitTimeSeconds: int & >=0 & <=20 | *0
		redrivePolicy?: {
			deadLetterTargetArn: string
			maxReceiveCount:     int & >=1 & <=1000
		}
		sqsManagedSseEnabled:         bool | *true
		kmsMasterKeyId?:              string
		kmsDataKeyReusePeriodSeconds: int & >=60 & <=86400 | *300
		contentBasedDeduplication:    bool | *false
		deduplicationScope?:          "queue" | "messageGroup"
		fifoThroughputLimit?:         "perQueue" | "perMessageGroupId"
		tags: [string]: string
	}

	outputs?: {
		queueUrl:  string
		queueArn:  string
		queueName: string
	}
}

View this schema on GitHub →