MicroticaMicrotica

Environment commands

Clone, deploy, wait on, and tear down Microtica environments and their resources from the CLI, with partial deploys and config management.

The env commands manage environments — the deployable units that hold your infrastructure resources on your cloud account. (In the API an environment is called a stage; the CLI calls it an environment.)

All env commands need a project id. Pass --project <id> or set MICROTICA_PROJECT_ID.

Inspect environments

env list

List the environments in a project with their id, name, and status.

Terminal
microtica env list
Output
id                    name         status
--------------------  -----------  ---------------
Production-aB12cD3eFg  Production   UPDATE_COMPLETE
Development-fQI6w86lyd Development  NOT_DEPLOYED

Status follows the CloudFormation-style vocabulary: NOT_DEPLOYED, and CREATE/UPDATE/DELETE paired with _IN_PROGRESS, _COMPLETE, or _FAILED. Environment ids take the form <DisplayName>-<suffix>.

env get

Show one environment's top-level metadata — cloud provider, region, IaC tool, status, and last-deploy info.

Terminal
microtica env get <envId>

env get omits resources. It returns environment metadata only. To see the resources in an environment and their stored configuration, use env get-details.

env get-details

Show the full environment, including each resource and its complete configurations array.

Terminal
microtica env get-details <envId>

# Just the resource names and their status
microtica env get-details <envId> --query "resources[].{name: name, status: status}"

env get-resource

Show one resource's full configuration within an environment.

Terminal
microtica env get-resource <envId> <resourceName>

Resource names are case-sensitive.

env last-deploy

Answer "when was this resource last deployed to this environment, from what commit, by whom?" in one call.

Terminal
microtica env last-deploy <resourceName> --env <envId>
FlagDescription
--env <id>Environment to scope the lookup to. Required.
--include-rawAttach the raw pipeline record on a raw field.

Resources in one environment deploy together as a single run, but each can sit at a different commit. This command returns the environment run's timestamps alongside the specific resource's commit and per-resource status, so you don't conflate the two.

Deploy and wait

env deploy

Trigger a deployment of an environment. The command returns immediately with the queued deployment id — pair it with env wait to block until it settles.

Terminal
# Deploy the whole environment
microtica env deploy <envId>

# Deploy only specific resources (repeatable)
microtica env deploy <envId> --partial-resource WebApp --partial-resource Api
FlagDescription
--partial-resource <name[=version]>Deploy only this resource. Repeatable. Append =<buildId> to pin an exact build, or omit it (or use =latest) to deploy the latest.

A partial deploy is required on a first deploy when a downstream resource reads an upstream resource's outputs at plan time — for example, EKS depending on a VPC's subnet ids. Deploy the upstream resource first, then the rest.

Partial deploys gate the apply, not the plan. With Terraform, the whole workspace is still planned on every deploy; only the apply set is limited. A plan-time error in any resource blocks the deploy regardless of which one you target.

env wait

Block until every resource in an environment reaches a terminal status (*_COMPLETE or *_FAILED).

Terminal
microtica env wait <envId> --timeout 1800 --poll-interval 10
FlagDefaultDescription
--timeout <seconds>1800Hard timeout.
--poll-interval <seconds>10How often to poll.

Clone and replicate

env clone

Clone a source environment into a new one. This copies resources and their configurations — applications deployed inside the cluster are not copied.

Terminal
microtica env clone <sourceEnvId> --to Staging
FlagDefaultDescription
--to <name>Name of the new environment. Required.
--description <desc>""Description of the new environment.
--cloud-provider <provider>AWSAWS, AZURE, GCP, or EXOSCALE.
--iac <tool>CFNCFN or Terraform.
--aws-account-id <id>Target AWS account id.
--aws-region <region>Target AWS region.

Cloning is idempotent: if an environment with the same name already exists, the command returns it instead of creating a duplicate. After cloning resources, deploy them with env deploy, then deploy your apps separately.

env replicate

Run the whole clone-to-running flow in one command: clone the source, apply overrides from a YAML/JSON file, deploy the resources, then deploy the apps.

Terminal
microtica env replicate <sourceEnvId> --to Staging --overrides ./overrides.yaml
FlagDefaultDescription
--overrides <path>YAML/JSON overrides file. Required.
--phase <which>bothresources, apps, or both.
--cluster-naming <pattern>{envId-lc}-eksPattern for the target cluster id when an app override doesn't set one. Placeholders: {envId}, {envId-lc}.
--timeout <seconds>1800Hard timeout for resource deployment.
--poll-interval <seconds>10Poll interval while waiting for resources.

Use --phase resources to clone and deploy infrastructure only, or --phase apps to deploy apps into an already-deployed target — for example after a wrapper script has rendered per-target secrets.

Manage resources

env add-resource

Add a new resource — an instance of a component — to an environment. Its configuration must satisfy the component's config schema for the chosen version.

Terminal
# See the config schema for the component version first
microtica env add-resource <envId> --component <componentId> --name my-db --show-schema

# Then create the resource
microtica env add-resource <envId> \
  --component <componentId> --name my-db \
  --set engine=postgres --secret db_password=s3cret
FlagDefaultDescription
--name <name>Resource (instance) name. Required.
--component <componentId>Component to instantiate. Required.
--version <version>latestComponent version (a build id, or latest).
--set <key=value>A config value. Repeatable.
--secret <key=value>A sensitive config value, stored masked. Repeatable.
--config-file <path>YAML/JSON file of configurations.
--show-schemaPrint the component's config schema and exit without creating anything.

The CLI validates your config against the schema before creating the resource: missing required keys fail, and keys the schema forbids are rejected.

env update-resource

Update a resource's configuration. By default the CLI merges your values onto the existing configuration, so you only pass what changes.

Terminal
# Merge: override just these keys, keep the rest
microtica env update-resource <envId> <resourceName> --config-file ./changes.yaml

# Replace the whole configuration set
microtica env update-resource <envId> <resourceName> --config-file ./full.yaml --no-merge
FlagDescription
--config-file <path>YAML/JSON configurations — a bare { key: value } map, or { configurations: [...] }.
--version <version>Component version to switch to.
--no-mergeReplace the entire configuration set instead of merging.

Avoid --no-merge on cloned environments. A full replace strips keys you didn't include — including required ones like vpc_id or subnet_ids that cloning set for you. Merge (the default) is almost always what you want.

env remove-resource

Remove a resource from an environment's spec. This is a spec change only — it doesn't tear down already-provisioned infrastructure. Run env deploy afterward to reconcile.

Terminal
microtica env remove-resource <envId> <resourceName>

Tear down

Both teardown commands are destructive and ask you to retype the environment id to confirm. Pass --yes to skip the prompt in scripts; without a terminal and without --yes, they refuse to run.

env undeploy

Destroy all the cloud resources an environment owns (terraform destroy / CloudFormation delete-stack). The Microtica environment record is preserved.

Terminal
microtica env undeploy <envId>

env undeploy deletes real cloud resources. RDS data, S3 contents, and EKS workloads go with it. This is not reversible.

env delete

Remove the environment's Microtica record. Run undeploy first if cloud resources are still up — otherwise they become orphans.

Terminal
microtica env delete <envId>
FlagDescription
--yesSkip the typed-name confirmation.
--forceSkip the safety check that blocks deletion while resources may still exist. Leaves AWS orphans.

Next steps

On this page