Deploy Prefix
Every deployment gets a unique 8-character hex prefix (e.g., a3f27b1d) that is prepended to new cloud resource names. This prevents name collisions between deployments sharing the same cloud account.
How It Works
Section titled “How It Works”- On first
planorapply, Kyku generates a random 8-character hex prefix. - The prefix is stored in
StateFile.metadata.prefix. - All new resources have the prefix prepended to their name:
a3f27b1d-web-server. - The prefix persists across subsequent runs — it’s reused from state.
What Gets Prefixed
Section titled “What Gets Prefixed”Resource name properties are proxied automatically:
const vm = new Vm({ id: 'vm-web', name: 'web-server' });// In provider code: resource.name === "a3f27b1d-web-server"The prefix is applied via a deep proxy — nested references also get correct names:
const vm = new Vm({ network: vpc, // vpc.name is also proxied securityGroups: [sg], // sg.name is also proxied});Existing Resources
Section titled “Existing Resources”Resources already tracked in state keep their original cloud names (whether prefixed or not). Only resources not yet in state get the prefix applied. This ensures backward compatibility with existing deployments.
Custom Prefix
Section titled “Custom Prefix”You can set a custom prefix via EngineOptions.deployPrefix:
const engine = new KykuEngine({ deployPrefix: 'myteam',});Or use the --deploy-prefix flag if exposed by the CLI (otherwise, custom prefixes require using the engine API directly).
Impact on Providers
Section titled “Impact on Providers”Providers don’t need changes — they receive resources with already-prefixed names via the proxy. All instanceof checks work correctly (the proxy preserves the prototype chain).
Name Length
Section titled “Name Length”The prefix adds 9 characters (8 hex + dash). Account for this when naming resources:
| Provider | Name Limit | Safe Name Length |
|---|---|---|
| Hetzner | 63 chars | 54 chars |
| AWS VPC | varies | ~50 chars |
| AWS ALB | 32 chars | 23 chars |
| GCP | 62 chars | 53 chars |
| DigitalOcean | 255 chars | 246 chars |