Resource definition
What this resource looks like
This is the CUE shape a Praxis template uses to declare a DynamoDBTable. The resource key is local to the template; metadata.name supplies its stable Praxis identity.
resources: sessions: {
apiVersion: "praxis.io/alpha"
kind: "DynamoDBTable"
metadata: {name: "payments-sessions", labels: {}}
spec: {
region: "us-west-2"
billingMode: "PAY_PER_REQUEST"
hashKey: "sessionId"
hashKeyType: "S"
tags: environment: "prod"
}
}Desired state
Configuration
The spec block accepts 9 fields. 3 are required by the schema; fields with defaults can be omitted.
regionRequiredRegion.
stringbillingModeOptionalMutable — billing mode. PAY_PER_REQUEST (on-demand) or PROVISIONED. readCapacity/writeCapacity are only meaningful for PROVISIONED.
"PAY_PER_REQUEST" | "PROVISIONED" | *"PAY_PER_REQUEST""PAY_PER_REQUEST"hashKeyRequiredImmutable after creation — the primary key schema. Changing any of these surfaces as an informational, requires-replacement diff.
stringhashKeyTypeOptionalHash Key Type.
"S" | "N" | "B" | *"S""S"rangeKeyOptionalRange Key.
stringrangeKeyTypeOptionalRange Key Type.
"S" | "N" | "B" | *"S""S"readCapacityOptionalMutable — provisioned throughput. Only applied when billingMode is PROVISIONED; ignored for PAY_PER_REQUEST.
int & >=1 | *55writeCapacityOptionalWrite Capacity.
int & >=1 | *55tagsRequiredTags.
[string]: stringObserved values
Outputs
Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.
arnStringnameStringstatusStringitemCountInteger · optionalRead without ownership
Data-source lookup
A data block reads an existing DynamoDBTable 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: "DynamoDBTable"
region: "us-west-2"
filter: {
name: "replace-with-provider-name"
}
}idnameid/name + tagAdopt existing infrastructure
Import
Import persists Praxis state for an existing AWS resource. For this kind, supply: Table name and region. The example starts in observed mode so Praxis reports drift without correcting it.
praxis import DynamoDBTable \
--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 dynamodb
#DynamoDBTable: {
apiVersion: "praxis.io/alpha"
kind: "DynamoDBTable"
metadata: {
// Table names are 3-255 chars: letters, digits, underscores, hyphens, dots.
name: string & =~"^[a-zA-Z0-9_.\\-]{3,255}$"
labels: [string]: string
}
spec: {
region: string
// Mutable — billing mode. PAY_PER_REQUEST (on-demand) or PROVISIONED.
// readCapacity/writeCapacity are only meaningful for PROVISIONED.
billingMode: "PAY_PER_REQUEST" | "PROVISIONED" | *"PAY_PER_REQUEST"
// Immutable after creation — the primary key schema. Changing any of
// these surfaces as an informational, requires-replacement diff.
hashKey: string
hashKeyType: "S" | "N" | "B" | *"S"
rangeKey?: string
rangeKeyType: "S" | "N" | "B" | *"S"
// Mutable — provisioned throughput. Only applied when billingMode is
// PROVISIONED; ignored for PAY_PER_REQUEST.
readCapacity: int & >=1 | *5
writeCapacity: int & >=1 | *5
tags: [string]: string
}
outputs?: {
arn: string
name: string
status: string
itemCount?: int
}
}