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.
kyku import <resourceType> <cloudId> [options]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
resourceType |
Resource type (e.g., Vpc, Vm, Bucket) |
cloudId |
Cloud provider resource ID |
Options
Section titled “Options”| 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 |
Examples
Section titled “Examples”# Import an existing VPCkyku import Vpc vpc-0abc123def456
# Import a VM with a custom namekyku import Vm i-0abc123456 --name=web-server
# Import into a specific environmentkyku import Vpc vpc-0abc123def456 --env=prod
# Import from a custom configkyku import Bucket my-s3-bucket -c ./infrastructure.tsBehavior
Section titled “Behavior”- Creates a stub resource with the given type and name
- Calls
provider.readState(stub, cloudId)to fetch current state - Writes the cloud state to the state file
- Resource is now tracked and will appear in
kyku planandkyku apply
Supported Types
Section titled “Supported Types”All resource types are supported: Vpc, Vm, Bucket, DnsZone, SecurityGroup, LoadBalancer, Database, Identity, Role, SshKey, Volume, Queue, Cache, KubernetesCluster, and more.