Skip to content

Quickstart

This walkthrough creates a VPC and a VM on AWS, then cleans up.

Terminal window
kyku init --provider=aws

This creates ./infrastructure.ts with a starter template.

Replace infrastructure.ts with:

import { Vpc, Vm, SecurityGroup } from '@kykucloud/types';
const vpc = new Vpc({
id: 'vpc-main',
name: 'main-vpc',
cidr: '10.0.0.0/16',
region: 'us-east',
});
const sg = new SecurityGroup({
id: 'sg-web',
name: 'web-sg',
ingress: [
{ protocol: 'tcp', fromPort: 22, toPort: 22, sources: ['0.0.0.0/0'] },
{ protocol: 'tcp', fromPort: 80, toPort: 80, sources: ['0.0.0.0/0'] },
],
});
const vm = new Vm({
id: 'vm-web',
name: 'web-server',
instanceType: 'small',
image: 'ubuntu-22.04',
network: vpc,
securityGroups: [sg],
});
export default { provider: 'aws', resources: [vpc, sg, vm] };
Terminal window
kyku plan

The plan output shows what will be created, updated, or destroyed. Expected output:

Plan: 3 to create, 0 to update, 0 to destroy
Terminal window
kyku apply --auto-approve

This provisions the VPC, security group, and VM on AWS. Progress is displayed in real-time.

Check outputs:

Terminal window
kyku output
Terminal window
kyku destroy --auto-approve

This destroys all resources tracked in state. Resources are destroyed in reverse dependency order (VM → SecurityGroup → VPC).

  • Read the First Config guide for a deeper walkthrough
  • Explore Concepts to understand the resource model
  • Check provider-specific guides for advanced configuration