Resource definition
What this resource looks like
This is the CUE shape a Praxis template uses to declare a AuroraCluster. The resource key is local to the template; metadata.name supplies its stable Praxis identity.
resources: {
auroraCluster: {
apiVersion: "praxis.io/alpha"
kind: "AuroraCluster"
metadata: name: "\(_naming.prefix)-aurora"
spec: {
region: _naming.region
engine: "aurora-postgresql"
engineVersion: "15.4"
masterUsername: "admin"
masterUserPassword: "ssm:///praxis/\(variables.environment)/aurora-password?sensitive=true"
databaseName: variables.name
port: 5432
dbSubnetGroupName: "${resources.dbSubnetGroup.outputs.groupName}"
vpcSecurityGroupIds: ["${resources.dataSg.outputs.groupId}"]
storageEncrypted: true
backupRetentionPeriod: 14
deletionProtection: variables.environment == "prod"
enabledCloudwatchLogsExports: ["postgresql"]
tags: #DataTags
}
lifecycle: preventDestroy: variables.environment == "prod"
}
}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 18 fields. 6 are required by the schema; fields with defaults can be omitted.
regionRequiredRegion.
stringengineRequiredEngine.
"aurora-postgresql" | "aurora-mysql"engineVersionRequiredEngine Version.
stringmasterUsernameRequiredMaster Username.
stringmasterUserPasswordRequiredMaster User Password.
stringdatabaseNameOptionalDatabase Name.
stringportOptionalPort.
int & >=1150 & <=65535dbSubnetGroupNameOptionalDb Subnet Group Name.
stringdbClusterParameterGroupNameOptionalDb Cluster Parameter Group Name.
stringvpcSecurityGroupIdsOptionalVpc Security Group IDs.
[...string] | *[][]storageEncryptedOptionalStorage Encrypted.
bool | *truetruekmsKeyIdOptionalKms Key ID.
stringbackupRetentionPeriodOptionalBackup Retention Period.
int & >=1 & <=35 | *77preferredBackupWindowOptionalPreferred Backup Window.
stringpreferredMaintenanceWindowOptionalPreferred Maintenance Window.
stringdeletionProtectionOptionalDeletion Protection.
bool | *falsefalseenabledCloudwatchLogsExportsOptionalEnabled Cloudwatch Logs Exports.
[...string] | *[][]tagsRequiredTags.
[string]: stringObserved values
Outputs
Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.
clusterIdentifierStringclusterResourceIdStringarnStringendpointStringreaderEndpointStringportIntegerengineStringengineVersionStringstatusStringRead without ownership
Data-source lookup
A data block reads an existing AuroraCluster 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: "AuroraCluster"
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 AuroraCluster. The example starts in observed mode so Praxis reports drift without correcting it.
praxis import AuroraCluster \
--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 rds
#AuroraCluster: {
apiVersion: "praxis.io/alpha"
kind: "AuroraCluster"
metadata: {
name: string & =~"^[a-zA-Z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$"
labels: [string]: string
}
spec: {
region: string
engine: "aurora-postgresql" | "aurora-mysql"
engineVersion: string
masterUsername: string
masterUserPassword: string
databaseName?: string
port?: int & >=1150 & <=65535
dbSubnetGroupName?: string
dbClusterParameterGroupName?: string
vpcSecurityGroupIds: [...string] | *[]
storageEncrypted: bool | *true
kmsKeyId?: string
backupRetentionPeriod: int & >=1 & <=35 | *7
preferredBackupWindow?: string
preferredMaintenanceWindow?: string
deletionProtection: bool | *false
enabledCloudwatchLogsExports: [...string] | *[]
tags: [string]: string
}
outputs?: {
clusterIdentifier: string
clusterResourceId: string
arn: string
endpoint: string
readerEndpoint: string
port: int
engine: string
engineVersion: string
status: string
}
}