Skip to content

nkapp infra

Manage cloud infrastructure settings and view current resource status.

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 the current infrastructure status from the local state file.

bash
nkapp infra status [-e <env>]

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

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

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 staging environment on AWS
nkapp infra destroy -e staging

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.