Route 53 · Operations

Route53Record

Manage DNS record sets inside a hosted zone.

Generic driverUniform lifecycle
Scope
Composite
Spec fields
13
Outputs
4
Lookup
Supported

Resource definition

What this resource looks like

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

CUE example
resources: {
  validationRecord: {
  	apiVersion: "praxis.io/alpha"
  	kind:       "Route53Record"
  	metadata: name: "\(variables.name)-\(variables.environment)-cert-validation"
  	spec: {
  		region:       "us-east-1"
  		hostedZoneId: variables.hostedZoneId
  		name:         "${resources.cert.outputs.dnsValidationRecords[0].resourceRecordName}"
  		type:         "CNAME"
  		ttl:          300
  		resourceRecords: [
  			"${resources.cert.outputs.dnsValidationRecords[0].resourceRecordValue}",
  		]
  	}
  }
}

Excerpted from examples/acm/https-stack.cue. Open the complete example for its variables and related resources.

Complete examples in the repository

Desired state

Configuration

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

hostedZoneIdRequired

Hosted Zone ID.

string
String
nameRequired

Name.

string
String
typeRequired

Type.

string
String
ttlOptional

Ttl.

int
Integer
resourceRecordsOptional

Resource Records.

[...string]
List
aliasTargetOptional

Alias Target.

{ hostedZoneId: string dnsName: string evaluateTargetHealth: bool | *false }
Object
setIdentifierOptional

Set Identifier.

string
String
weightOptional

Weight.

int
Integer
regionOptional

Region.

string
String
failoverOptional

Failover.

"PRIMARY" | "SECONDARY"
Enum
geoLocationOptional

Geo Location.

{ continentCode?: string countryCode?: string subdivisionCode?: string }
Object
multiValueAnswerOptional

Multi Value Answer.

bool
Boolean
healthCheckIdOptional

Health Check ID.

string
String

Observed values

Outputs

Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.

hostedZoneIdString
fqdnString
typeString
setIdentifierString · optional

Read without ownership

Data-source lookup

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

CLI
praxis import Route53Record \
  --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/route53/record.cue
package route53

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

	metadata: {
		name: string & =~"^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$"
		labels: [string]: string
	}

	spec: {
		hostedZoneId: string
		name:         string
		type:         string
		ttl?:         int
		resourceRecords?: [...string]
		aliasTarget?: {
			hostedZoneId:         string
			dnsName:              string
			evaluateTargetHealth: bool | *false
		}
		setIdentifier?: string
		weight?:        int
		region?:        string
		failover?:      "PRIMARY" | "SECONDARY"
		geoLocation?: {
			continentCode?:   string
			countryCode?:     string
			subdivisionCode?: string
		}
		multiValueAnswer?: bool
		healthCheckId?:    string
	}

	outputs?: {
		hostedZoneId:   string
		fqdn:           string
		type:           string
		setIdentifier?: string
	}
}

View this schema on GitHub →