EKS · Compute

EKSCluster

Manage the lifecycle and configuration of EKS clusters.

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

Resource definition

What this resource looks like

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

CUE example
resources: {
  kubernetes: {
  	apiVersion: "praxis.io/alpha"
  	kind:       "EKSCluster"
  	metadata: name: "\(variables.name)-eks"
  	spec: {
  		region:                variables.region
  		roleArn:               variables.eksRoleArn
  		subnetIds:             variables.eksSubnetIds
  		securityGroupIds:      [variables.eksSecurityGroupId]
  		endpointPublicAccess:  true
  		endpointPrivateAccess: true
  		publicAccessCidrs:     ["203.0.113.0/24"]
  		enabledLoggingTypes:   ["api", "audit", "authenticator"]
  		tags:                  _tags
  	}
  }
}

Excerpted from examples/stacks/foundation-services.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. 7 are required by the schema; fields with defaults can be omitted.

regionRequired

Region.

string
String
roleArnRequired

Immutable after creation — changes surface as informational, requires-replacement diffs during reconciliation.

string
String
subnetIdsRequired

Subnet IDs.

[...string]
List
securityGroupIdsRequired

Security Group IDs.

[...string]
List
versionOptional

Mutable — the Kubernetes control-plane version. When omitted, AWS selects the current default. Only upgrades are supported.

string
String
endpointPublicAccessOptional

Mutable — control-plane endpoint access. Defaults mirror AWS.

bool | *true
BooleanDefault true
endpointPrivateAccessOptional

Endpoint Private Access.

bool | *false
BooleanDefault false
publicAccessCidrsRequired

Public Access Cidrs.

[...string]
List
enabledLoggingTypesRequired

Mutable — control-plane log types shipped to CloudWatch Logs.

[...("api" | "audit" | "authenticator" | "controllerManager" | "scheduler")]
List
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>}.

arnString
nameString
statusString
versionString
platformVersionString
endpointString

Read without ownership

Data-source lookup

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

CLI
praxis import EKSCluster \
  --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/eks/cluster.cue
package eks

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

	metadata: {
		// Cluster names are 1-100 chars: letters, digits, hyphens, underscores.
		name: string & =~"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,99}$"
		labels: [string]: string
	}

	spec: {
		region: string

		// Immutable after creation — changes surface as informational,
		// requires-replacement diffs during reconciliation.
		roleArn:          string
		subnetIds: [...string]
		securityGroupIds: [...string]

		// Mutable — the Kubernetes control-plane version. When omitted, AWS
		// selects the current default. Only upgrades are supported.
		version?: string

		// Mutable — control-plane endpoint access. Defaults mirror AWS.
		endpointPublicAccess:  bool | *true
		endpointPrivateAccess: bool | *false
		publicAccessCidrs: [...string]

		// Mutable — control-plane log types shipped to CloudWatch Logs.
		enabledLoggingTypes: [...("api" | "audit" | "authenticator" | "controllerManager" | "scheduler")]

		tags: [string]: string
	}

	outputs?: {
		arn:             string
		name:            string
		status:          string
		version:         string
		platformVersion: string
		endpoint:        string
	}
}

View this schema on GitHub →