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.
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.
Desired state
Configuration
The spec block accepts 16 fields. 3 are required by the schema; fields with defaults can be omitted.
regionRequiredRegion.
stringqueueNameRequiredQueue Name.
string & =~"^[a-zA-Z0-9_-]{1,80}(\\.fifo)?$"fifoQueueOptionalFifo Queue.
bool | *falsefalsevisibilityTimeoutOptionalVisibility Timeout.
int & >=0 & <=43200 | *3030messageRetentionPeriodOptionalMessage Retention Period.
int & >=60 & <=1209600 | *345600345600maximumMessageSizeOptionalMaximum Message Size.
int & >=1024 & <=262144 | *262144262144delaySecondsOptionalDelay Seconds.
int & >=0 & <=900 | *00receiveMessageWaitTimeSecondsOptionalReceive Message Wait Time Seconds.
int & >=0 & <=20 | *00redrivePolicyOptionalRedrive Policy.
{ deadLetterTargetArn: string maxReceiveCount: int & >=1 & <=1000 }sqsManagedSseEnabledOptionalSqs Managed SSE Enabled.
bool | *truetruekmsMasterKeyIdOptionalKms Master Key ID.
stringkmsDataKeyReusePeriodSecondsOptionalKms Data Key Reuse Period Seconds.
int & >=60 & <=86400 | *300300contentBasedDeduplicationOptionalContent Based Deduplication.
bool | *falsefalsededuplicationScopeOptionalDeduplication Scope.
"queue" | "messageGroup"fifoThroughputLimitOptionalFifo Throughput Limit.
"perQueue" | "perMessageGroupId"tagsRequiredTags.
[string]: stringObserved values
Outputs
Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.
queueUrlStringqueueArnStringqueueNameStringRead 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.
data: existing: {
kind: "SQSQueue"
region: "us-west-2"
filter: {
name: "replace-with-provider-name"
}
}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.
praxis import SQSQueue \
--id <provider-identifier> \
--region us-west-2 \
--account production \
--observeCanonical 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
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
}
}