Skip to main content
Complete these first:

Overview

As your application grows, add more resources to its infrastructure.ts. The fjall add command edits the file through the codemod engine, then fjall deploy provisions the change on AWS. Every add follows one shape:
There is no colon syntax. fjall add database:Aurora is invalid. The database variant is a property: fjall add database --type Aurora.

Add a database

Add a database and pick the variant with --type:
The variant determines the database engine and topology.

Multiple databases

An application can hold several databases. Give each a distinct PascalCase name:

Interactive connection prompt

When you run fjall add interactively and existing compute resources are present, the wizard offers to wire the database to them:
If exactly one compute target exists, the wizard selects it automatically and skips the multi-select.

Add storage (S3)

Add an S3 bucket:

Add compute

The compute type covers Lambda functions and ECS services. Pick the variant interactively, or pass it as a property in non-interactive mode.
The wizard prompts for the variant and its settings:

Add a CDN

Add a CloudFront distribution:

What happens on add

When you add a resource, Fjall configures the supporting wiring automatically:
  1. Security groups open the required ports
  2. Environment variables carry connection strings into connected compute
  3. Secrets hold database passwords in Secrets Manager
  4. IAM roles receive the permissions the resource needs

Connection environment variables

Connected compute receives connection details as environment variables. The first database uses unsuffixed names, and additional databases get numbered suffixes:

Worked examples

Microservice setup

Data pipeline


Non-interactive mode

Pass --non-interactive to add a resource without prompts. Supply every required property as a flag:

Deploy after adding

Adding a resource only edits infrastructure.ts. Provision it with a deploy:
Fjall reports what it will change:

List resources

fjall list reads the resources defined in an application’s infrastructure.ts. The application is selected with -a, --app, and an optional [type] positional filters the output:

Best practices


All resource types

Add resources at any time. Fjall configures networking and security automatically on the next deploy.

Next Steps

Deploy Application

Provision your updated infrastructure on AWS

Remove Resources

Remove a resource from infrastructure.ts