Resource definition
What this resource looks like
This is the CUE shape a Praxis template uses to declare a S3Bucket. The resource key is local to the template; metadata.name supplies its stable Praxis identity.
resources: archive: {
apiVersion: "praxis.io/alpha"
kind: "S3Bucket"
metadata: {name: "payments-prod-archive", labels: {}}
spec: {
region: "us-west-2"
versioning: true
encryption: {
enabled: true
algorithm: "AES256"
}
tags: environment: "prod"
}
}Desired state
Configuration
The spec block accepts 5 fields. 3 are required by the schema; fields with defaults can be omitted.
regionRequiredRegion.
stringversioningOptionalVersioning.
bool | *truetrueaclOptionalAcl.
"private" | "public-read" | *"private""private"encryptionRequiredEncryption.
{ enabled: bool | *true algorithm: *"AES256" | "aws:kms" }tagsRequiredTags.
[string]: stringObserved values
Outputs
Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.
arnStringbucketNameStringregionStringdomainNameStringRead without ownership
Data-source lookup
A data block reads an existing S3Bucket 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: "S3Bucket"
region: "us-west-2"
filter: {
name: "replace-with-provider-name"
}
}idnametagAdopt existing infrastructure
Import
Import persists Praxis state for an existing AWS resource. For this kind, supply: Bucket name. The example starts in observed mode so Praxis reports drift without correcting it.
praxis import S3Bucket \
--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 s3
#S3Bucket: {
apiVersion: "praxis.io/alpha"
kind: "S3Bucket"
metadata: {
// Bucket names must follow S3's naming rules:
// 3-63 characters, lowercase letters, numbers, hyphens, periods.
name: string & =~"^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$"
labels: [string]: string
}
spec: {
region: string
versioning: bool | *true // default: enabled (best practice)
acl: "private" | "public-read" | *"private"
encryption: {
enabled: bool | *true // default: enabled (AWS best practice since Jan 2023)
algorithm: *"AES256" | "aws:kms"
}
tags: [string]: string
}
// Outputs are populated by the driver after provisioning.
// These fields are referenced in output expressions by dependent resources.
// Optional at template time — the driver fills them after Provision.
outputs?: {
arn: string
bucketName: string
region: string
domainName: string
}
}