Skip to content

Resources

Every piece of infrastructure in Kyku is a resource — an instance of a class extending BaseResource.

abstract class BaseResource {
abstract readonly type: ResourceType
readonly id: string
readonly name: string
readonly provider?: string
readonly tags?: Record<string, string>
readonly outputs: OutputAccessor
}
Property Description
id Logical identifier used for state tracking and dependency resolution. Auto-generated UUID if omitted.
name Cloud resource name. May be prefixed automatically (see Deploy Prefix).
type Discriminated union tag — 'Vpc', 'Vm', 'SecurityGroup', etc.
provider Override the default provider for multi-provider configs.
tags Key-value metadata mapped to provider-native labels/tags.
outputs Proxy for resolved cloud outputs (IPs, ARNs, endpoints).

All supported resource types:

Vpc · Subnet · Vm · SecurityGroup · LoadBalancer · TargetGroup · Database · Identity · Role · SshKey · Bucket · DnsZone · DnsRecord · Secret · Certificate · KmsKey · Volume · AutoScalingGroup · Queue · Cache · KubernetesCluster · Custom · K8sNamespace · K8sConfigMap · K8sSecret · K8sPersistentVolumeClaim · K8sDeployment · K8sStatefulSet · K8sService · K8sIngress · K8sManifest · K8sHelmRelease

Every resource has a matching Config interface:

interface VmConfig extends ResourceConfig {
readonly instanceType: InstanceType
readonly image: ImageType
readonly network: Vpc | string
readonly subnet?: Subnet | string
readonly securityGroups?: (SecurityGroup | string)[]
// ...
}

The config interface defines all user-settable properties. Provider-specific configs are never needed — use the abstract types.

Resources are defined with abstract types instead of provider-specific values:

instanceType: 'small' // NOT 't3.small' or 'e2-small'
image: 'ubuntu-22.04' // NOT 'ami-0c55b159cbfafe1f0'
region: 'us-east' // NOT 'us-east-1' or 'us-central1'

The provider maps these to native values during validation and creation.

validate → plan → create / read / update / destroy
  1. validate — Provider checks the config: does the instance type exist? Is the CIDR valid? Throws UnsupportedFeatureError for unsupported resource types.
  2. plan — Engine diffs config against state to determine create/update/replace/destroy/no-op.
  3. create — Provider provisions the resource in the cloud.
  4. read — Provider fetches current state from the cloud (for drift detection).
  5. update — Provider modifies an existing resource (in-place or replace).
  6. destroy — Provider removes the resource from the cloud.

See the Resources section for detailed config options per resource type.