Skip to main content
Interactive command. Guides you through selecting and deploying targets with real-time feedback.

Overview

fjall deploy ships your infrastructure to AWS. It handles organisation-level deployments (AWS Organization, SSO, accounts) and application deployments (compute, storage, networking).

Prerequisites

  • Logged in with fjall login.
  • An AWS account connected with fjall connect.
  • In organisation mode, an active deployment target selected with fjall target set <name>.

Usage

Deploy Targets

target accepts an application name, one of organisation, platform, or account, or domain <name>. All are standalone deployable targets.

Cascade behaviour

organisation cascades: it deploys the organisation infrastructure, then the platform and every member account. Opt out with --no-cascade to deploy the organisation stack alone. platform and account never cascade. Each deploys its own stack only.

Deploying a domain

fjall deploy domain <name> routes through the same operation as fjall domain deploy <name> — the two spellings have identical flags and exit semantics. Domain-specific semantics:
  • --allow-replace is rejected on domain deploys — not silently dropped. Consent to takeover rows with --remediate '<name>/<TYPE>'=recreate — or --remediate '<name>/<TYPE>@<setIdentifier>'=recreate when the live record set carries a SetIdentifier (weighted, latency, and failover variants are classified and consented per variant).
  • Exit 4 means the takeover consent was withheld: success-shaped, nothing released, nothing deployed. See Destructive Changes.
  • --plan runs the same two-step as application deploys — a domain plan additionally prints any record-takeover ticket, exits 2 when changes are pending approval (nothing mutated), and resumes via --approval-token.

Interactive Mode

Run without arguments for guided deployment:
The picker asks what to deploy, then which application:
Choosing Organisation shows a cascade confirmation (Deploy Organisation, Platform and Accounts?). Choosing Platform or Account deploys that single stack immediately with no cascade prompt.

Options

Plan and approval options

These satisfy the destruction gate when a deploy would destroy or replace a stateful resource:
-e, --environment <env> does not select an account or region. It is an optional free-form label for CI/CD that flows into CDK synthesis as a context value. The account is chosen by the active target (or --target), not by --environment.

Choosing the Deploy Account

In organisation mode, the account a deploy lands in is the active deployment target, an account plus region pair named <accountname>-<regionabbrev> (for example production-us-use1). At deploy time the account resolves in this order:
  1. The per-deploy --target <name> flag, when present.
  2. Otherwise the activeTarget stored in fjall-config.json. With exactly one target it is selected automatically; with several you must run fjall target set first.
Targets are derived at runtime from your organisation config (fetched from the Fjall API), not authored by hand. See Understanding Profiles for how authentication and account selection fit together.

Deployment Process

1. Pre-flight Checks

Fjall validates:
  • AWS credentials and permissions
  • Target exists and is valid
  • Required dependencies installed
  • No conflicts with existing resources
  • The stacks are not wedged by resources deleted outside CloudFormation (a confirmed out-of-band deletion blocks the deploy and points you at fjall drift)

2. Infrastructure Synthesis

For each deployment, Fjall:
  • Compiles the TypeScript CDK code
  • Generates CloudFormation templates
  • Calculates resource changes
  • Identifies security implications

3. Deployment Preview

If the computed plan would destroy or replace a stateful resource, the deploy stops at an unconditional gate before anything is applied and asks for consent by exact resource name. No flag skips it. See Destructive Changes.

4. Deployment Execution

Fjall creates the CloudFormation stacks, monitors progress, handles dependencies, and reports errors immediately.

5. Post-Deployment

After a successful deployment, Fjall displays resource endpoints, connection strings, next steps, and updates local configuration.

Examples

Deploy the organisation first time

Deploy an application

Infrastructure vs code

Fjall image tags are content-addressed: <service>-sha-<12 hex chars of the image digest>. Find the tags for an application in its ECR repository (AWS console or aws ecr list-images). Tags like v1.4.2 are not produced by Fjall builds and will not resolve.

Understanding Output

Success output

Progress indicators

Handling Failures

Common issues

  1. Permission denied
    Fix: Give your AWS user AdministratorAccess.
  2. Resource already exists
    Fix: Run fjall destroy first, or choose a different name.
  3. Invalid credentials
    Fix: Run fjall connect to re-establish your AWS connection, or fjall login to re-authenticate with Fjall.

Recovery steps

If a deployment fails:
  1. Read the error for the specific failure message.
  2. Check CloudFormation in the AWS Console for stack-level detail.
  3. Roll back if needed (CloudFormation auto-rolls-back on failure).
  4. Fix and retry once you have addressed the issue.

Exit Codes

Best Practices

  1. Review changes before confirming the deployment preview.
  2. Deploy incrementally, starting with non-production targets.
  3. Use verbose mode (-v) for troubleshooting.
  4. Back up data before major changes.

Next Steps

List resources

Inspect the resources in an application’s infrastructure.

Add resources

Add a database, storage, or compute resource.

Manage secrets

Store and read application secrets in AWS.

Understanding Profiles

See how auth and account selection are derived.
First deployment typically takes 10-15 minutes. Subsequent updates are faster as only changed resources are modified.