EC2 · Compute

EBSVolume

Provision and reconcile EBS block volumes.

Generic driverUniform lifecycle
Scope
Regional
Spec fields
10
Outputs
7
Lookup
Supported

Resource definition

What this resource looks like

This is the CUE shape a Praxis template uses to declare a EBSVolume. The resource key is local to the template; metadata.name supplies its stable Praxis identity.

CUE example
resources: {
  dbVolume: {
  	apiVersion: "praxis.io/alpha"
  	kind:       "EBSVolume"
  	metadata: name: "\(variables.name)-\(variables.environment)-db"
  	spec: {
  		region:           "us-east-1"
  		availabilityZone: variables.az
  		volumeType:       "io2"
  		sizeGiB:          50
  		iops:             3000
  		encrypted:        true
  		tags: {
  			app:     variables.name
  			env:     variables.environment
  			purpose: "database"
  		}
  	}
  }
}

Excerpted from examples/ec2/ebs-data-tier.cue. Open the complete example for its variables and related resources.

Complete examples in the repository

Desired state

Configuration

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

regionRequired

Region.

string
String
availabilityZoneRequired

Availability Zone.

string
String
volumeTypeOptional

Volume Type.

"gp2" | "gp3" | "io1" | "io2" | "st1" | "sc1" | *"gp3"
EnumDefault "gp3"
sizeGiBOptional

Size Gi B.

int & >=1 & <=16384 | *20
IntegerDefault 20
iopsOptional

Iops.

int & >=100
Integer
throughputOptional

Throughput.

int & >=125 & <=1000
Integer
encryptedOptional

Encrypted.

bool | *true
BooleanDefault true
kmsKeyIdOptional

Kms Key ID.

string
String
snapshotIdOptional

Snapshot ID.

string & =~"^snap-[a-f0-9]{8,17}$"
String
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>}.

volumeIdString
arnString · optional
availabilityZoneString
stateString
sizeGiBInteger
volumeTypeString
encryptedBoolean

Read without ownership

Data-source lookup

A data block reads an existing EBSVolume 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: "EBSVolume"
  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 EBSVolume. The example starts in observed mode so Praxis reports drift without correcting it.

CLI
praxis import EBSVolume \
  --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/ebs/ebs.cue
package ebs

#EBSVolume: {
	apiVersion: "praxis.io/alpha"
	kind:       "EBSVolume"

	metadata: {
		name: string & =~"^[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}$"
		labels: [string]: string
	}

	spec: {
		region:           string
		availabilityZone: string
		volumeType:       "gp2" | "gp3" | "io1" | "io2" | "st1" | "sc1" | *"gp3"
		sizeGiB:          int & >=1 & <=16384 | *20
		iops?:            int & >=100
		throughput?:      int & >=125 & <=1000
		encrypted:        bool | *true
		kmsKeyId?:        string
		snapshotId?:      string & =~"^snap-[a-f0-9]{8,17}$"
		tags: [string]: string
	}

	outputs?: {
		volumeId:         string
		arn?:             string
		availabilityZone: string
		state:            string
		sizeGiB:          int
		volumeType:       string
		encrypted:        bool
	}
}

View this schema on GitHub →