Skip to content

import

Adopt an existing cloud resource into Kyku management without recreating it. Creates a state entry for the resource so Kyku can manage it going forward.

Terminal window
kyku import <resourceType> <cloudId> [options]
Argument Description
resourceType Resource type (e.g., Vpc, Vm, Bucket)
cloudId Cloud provider resource ID
Flag Default Description
-n, --name <name> Name for the resource in Kyku state
-c, --config <path> ./infrastructure.ts Path to config file
-e, --env <environment> default Environment workspace
-p, --passphrase <phrase> Passphrase for encrypted state
Terminal window
# Import an existing VPC
kyku import Vpc vpc-0abc123def456
# Import a VM with a custom name
kyku import Vm i-0abc123456 --name=web-server
# Import into a specific environment
kyku import Vpc vpc-0abc123def456 --env=prod
# Import from a custom config
kyku import Bucket my-s3-bucket -c ./infrastructure.ts
  1. Creates a stub resource with the given type and name
  2. Calls provider.readState(stub, cloudId) to fetch current state
  3. Writes the cloud state to the state file
  4. Resource is now tracked and will appear in kyku plan and kyku apply

All resource types are supported: Vpc, Vm, Bucket, DnsZone, SecurityGroup, LoadBalancer, Database, Identity, Role, SshKey, Volume, Queue, Cache, KubernetesCluster, and more.