Resource definition
What this resource looks like
This is the CUE shape a Praxis template uses to declare a VPC. The resource key is local to the template; metadata.name supplies its stable Praxis identity.
resources: network: {
apiVersion: "praxis.io/alpha"
kind: "VPC"
metadata: {name: "payments", labels: {}}
spec: {
region: "us-west-2"
cidrBlock: "10.42.0.0/16"
enableDnsHostnames: true
enableDnsSupport: true
tags: environment: "prod"
}
}Desired state
Configuration
The spec block accepts 6 fields. 3 are required by the schema; fields with defaults can be omitted.
regionRequiredregion is the AWS region to create the VPC in.
stringcidrBlockRequiredcidrBlock is the primary IPv4 CIDR block for the VPC. Must be a valid CIDR in the range /16 to /28. Immutable after creation — changing this requires VPC replacement.
string & =~"^([0-9]{1,3}\\.){3}[0-9]{1,3}/([0-9]|[12][0-9]|3[0-2])$"enableDnsHostnamesOptionalenableDnsHostnames controls whether instances in the VPC receive public DNS hostnames. Requires enableDnsSupport to be true. Default: false for non-default VPCs.
bool | *falsefalseenableDnsSupportOptionalenableDnsSupport controls whether DNS resolution is supported in the VPC. Default: true.
bool | *truetrueinstanceTenancyOptionalinstanceTenancy defines the default tenancy for instances launched into this VPC. Once set to "dedicated", it cannot be changed back to "default" (AWS restriction). - "default": instances launch on shared hardware (most common). - "dedicated": instances launch on single-tenant hardware (higher cost). Immutable after creation.
"default" | "dedicated" | *"default""default"tagsRequiredtags applied to the VPC resource.
[string]: stringObserved values
Outputs
Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.
vpcIdStringarnStringcidrBlockStringstateStringenableDnsHostnamesBooleanenableDnsSupportBooleaninstanceTenancyStringownerIdStringdhcpOptionsIdStringisDefaultBooleanRead without ownership
Data-source lookup
A data block reads an existing VPC 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: "VPC"
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: VPC ID and region, for example vpc-0123456789abcdef0 in us-west-2. The example starts in observed mode so Praxis reports drift without correcting it.
praxis import VPC \
--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 vpc
#VPC: {
apiVersion: "praxis.io/alpha"
kind: "VPC"
metadata: {
name: string & =~"^[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}$"
labels: [string]: string
}
spec: {
// region is the AWS region to create the VPC in.
region: string
// cidrBlock is the primary IPv4 CIDR block for the VPC.
// Must be a valid CIDR in the range /16 to /28.
// Immutable after creation — changing this requires VPC replacement.
cidrBlock: string & =~"^([0-9]{1,3}\\.){3}[0-9]{1,3}/([0-9]|[12][0-9]|3[0-2])$"
// enableDnsHostnames controls whether instances in the VPC receive
// public DNS hostnames. Requires enableDnsSupport to be true.
// Default: false for non-default VPCs.
enableDnsHostnames: bool | *false
// enableDnsSupport controls whether DNS resolution is supported in the VPC.
// Default: true.
enableDnsSupport: bool | *true
// instanceTenancy defines the default tenancy for instances launched
// into this VPC. Once set to "dedicated", it cannot be changed back
// to "default" (AWS restriction).
// - "default": instances launch on shared hardware (most common).
// - "dedicated": instances launch on single-tenant hardware (higher cost).
// Immutable after creation.
instanceTenancy: "default" | "dedicated" | *"default"
// tags applied to the VPC resource.
tags: [string]: string
}
outputs?: {
vpcId: string
arn: string
cidrBlock: string
state: string
enableDnsHostnames: bool
enableDnsSupport: bool
instanceTenancy: string
ownerId: string
dhcpOptionsId: string
isDefault: bool
}
}