Prerequisites
Prerequisites
Complete these first:
- Deploy Application
- A deployed Fjall application
Overview
As your application grows, add more resources to itsinfrastructure.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:
Multiple databases
An application can hold several databases. Give each a distinct PascalCase name:Interactive connection prompt
When you runfjall add interactively and existing compute resources are present, the wizard offers to wire the database to them:
Add storage (S3)
Add an S3 bucket:Add compute
Thecompute type covers Lambda functions and ECS services. Pick the variant interactively, or pass it as a property in non-interactive mode.
Add a CDN
Add a CloudFront distribution:What happens on add
When you add a resource, Fjall configures the supporting wiring automatically:- Security groups open the required ports
- Environment variables carry connection strings into connected compute
- Secrets hold database passwords in Secrets Manager
- 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 editsinfrastructure.ts. Provision it with a deploy:
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