Quickstart
This walkthrough creates a VPC and a VM on AWS, then cleans up.
1. Scaffold a Project
Section titled “1. Scaffold a Project”kyku init --provider=awsThis creates ./infrastructure.ts with a starter template.
2. Write a Config
Section titled “2. Write a Config”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] };3. Preview Changes
Section titled “3. Preview Changes”kyku planThe plan output shows what will be created, updated, or destroyed. Expected output:
Plan: 3 to create, 0 to update, 0 to destroy4. Apply
Section titled “4. Apply”kyku apply --auto-approveThis provisions the VPC, security group, and VM on AWS. Progress is displayed in real-time.
5. Verify
Section titled “5. Verify”Check outputs:
kyku output6. Clean Up
Section titled “6. Clean Up”kyku destroy --auto-approveThis destroys all resources tracked in state. Resources are destroyed in reverse dependency order (VM → SecurityGroup → VPC).
Next Steps
Section titled “Next Steps”- Read the First Config guide for a deeper walkthrough
- Explore Concepts to understand the resource model
- Check provider-specific guides for advanced configuration