Skip to content

nkapp infra ​

Manage cloud infrastructure and inspect current resource state.

bash
nkapp infra <subcommand> [options]

Subcommands ​

infra apply ​

Directly reconcile infrastructure without deploying services. This is an internal/advanced command.

bash
nkapp infra apply [-e <env>]
FlagTypeDefaultDescription
-e, --env <env>stringlocalTarget environment

infra status ​

Show infrastructure status from the local state file.

bash
nkapp infra status [-e <env>]

Displays all recorded resources with their ID, status, and type:

Current Infrastructure Status:
──────────────────────────────────────────
✔ abc123def456... | running    | container
✔ 789xyz012345... | running    | container
──────────────────────────────────────────

This reads local state, not the provider

infra status reports what Nanokit recorded, which can be stale — after a resource was removed outside Nanokit, or a state file was lost. For ground truth, use infra resources below.


infra resources ​

Show a live cloud resource inventory, queried straight from the provider APIs across all environments.

bash
nkapp infra resources [-e <env>] [--provider <name>] [--orphans]
FlagTypeDefaultDescription
-e, --env <env>stringallLimit the inventory to one environment
--provider <name>docker | aws | gcp | azure | digitaloceanallFilter by provider
--orphansbooleanfalseShow only resources not declared in nanokit.yml

Output is grouped: environment → provider · region → type → rows.

--orphans is the fastest way to find resources that are costing money without being declared anywhere — the cloud counterpart to volumes prune and images prune.


Editing infrastructure settings ​

Infrastructure properties in nanokit.yml are edited with nkapp config infra set (not an infra subcommand):

bash
# Set global provider
nkapp config infra set provider=aws

# Set local provider
nkapp config infra set provider=docker -e local

# Set region for production
nkapp config infra set region=eu-west-1 -e production

Common keys: provider, region, scaling, min, max.


infra destroy ​

Nuclear option to wipe all remote infrastructure for a specific environment.

bash
nkapp infra destroy [-e <env>] [-y]
FlagTypeDefaultDescription
-e, --env <env>stringlocalEnvironment to destroy
-y, --yesbooleanfalseSkip confirmation prompt

This command performs a deep cleanup of the provider's resources (VPC, Clusters, Load Balancers, etc.) without touching local state files. Use this to decommission an environment or clean up after a failed deployment.

bash
# Wipe the staging environment on AWS
nkapp infra destroy -e stage

infra unlock ​

Manually clear stale infrastructure locks (e.g., provisioning locks on shared volumes).

bash
nkapp infra unlock [-e <env>]
FlagTypeDefaultDescription
-e, --env <env>stringlocalEnvironment to unlock

Use this command if a deployment was interrupted and subsequent runs are blocked by a "Shared modules are being initialized..." or "Lock held by another process" message.