RDS · Data

AuroraCluster

Manage Aurora database clusters and core configuration.

Generic driverUniform lifecycle
Scope
Regional
Spec fields
18
Outputs
9
Lookup
Supported

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.

CUE example
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.

Complete examples in the repository

Desired state

Configuration

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

regionRequired

Region.

string
String
engineRequired

Engine.

"aurora-postgresql" | "aurora-mysql"
Enum
engineVersionRequired

Engine Version.

string
String
masterUsernameRequired

Master Username.

string
String
masterUserPasswordRequired

Master User Password.

string
String
databaseNameOptional

Database Name.

string
String
portOptional

Port.

int & >=1150 & <=65535
Integer
dbSubnetGroupNameOptional

Db Subnet Group Name.

string
String
dbClusterParameterGroupNameOptional

Db Cluster Parameter Group Name.

string
String
vpcSecurityGroupIdsOptional

Vpc Security Group IDs.

[...string] | *[]
ListDefault []
storageEncryptedOptional

Storage Encrypted.

bool | *true
BooleanDefault true
kmsKeyIdOptional

Kms Key ID.

string
String
backupRetentionPeriodOptional

Backup Retention Period.

int & >=1 & <=35 | *7
IntegerDefault 7
preferredBackupWindowOptional

Preferred Backup Window.

string
String
preferredMaintenanceWindowOptional

Preferred Maintenance Window.

string
String
deletionProtectionOptional

Deletion Protection.

bool | *false
BooleanDefault false
enabledCloudwatchLogsExportsOptional

Enabled Cloudwatch Logs Exports.

[...string] | *[]
ListDefault []
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>}.

clusterIdentifierString
clusterResourceIdString
arnString
endpointString
readerEndpointString
portInteger
engineString
engineVersionString
statusString

Read 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.

CUE data source
data: existing: {
  kind: "AuroraCluster"
  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 AuroraCluster. The example starts in observed mode so Praxis reports drift without correcting it.

CLI
praxis import AuroraCluster \
  --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/rds/aurora_cluster.cue
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
	}
}

View this schema on GitHub →