Skip to main content
Once your infrastructure is under management, most of your work is routine: look at what you have, find a specific resource, make a small change without disturbing the rest, and remove what you no longer need. This guide collects those everyday operations.

See what formae manages

List everything under management:
  formae inventory
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 ╭─────────────╮
  1 Resources    2 Targets    3 Stacks    4 Policies 
─╯             ╰────────────────────────────────────────────────────────────────────────────────────────────────────

Label ▲                   Stack            Type                          NativeID                           
────────────────────────────────────────────────────────────────────────────────────────────────────────────
lifeline-alb-http-ingress lifeline         AWS::EC2::SecurityGroupIngresssgr-0ffb678dce902c817              
lifeline-alb-sg           lifeline         AWS::EC2::SecurityGroup       sg-00ec7ea75992bcc27               
lifeline-igw              lifeline         AWS::EC2::InternetGateway     igw-04356683dcee09288              
lifeline-igw-attachment   lifeline         AWS::EC2::VPCGatewayAttachmentIGW|vpc-043bbacbd0ebea8e5          
lifeline-public-route     lifeline         AWS::EC2::Route               rtb-01d9445d47e4f00f8|0.0.0.0/0|Ga…
lifeline-public-rt        lifeline         AWS::EC2::RouteTable          rtb-01d9445d47e4f00f8              
lifeline-public-subnet-1  lifeline         AWS::EC2::Subnet              subnet-0451bdccb16a96a55           
lifeline-public-subnet-1-…lifeline         AWS::EC2::SubnetRouteTableAss…rtbassoc-02a56640c3d1fd589         
lifeline-public-subnet-2  lifeline         AWS::EC2::Subnet              subnet-05c570615c4b79d89           
lifeline-public-subnet-2-…lifeline         AWS::EC2::SubnetRouteTableAss…rtbassoc-0603dbe3b5c152211         
lifeline-task-http-ingresslifeline         AWS::EC2::SecurityGroupIngresssgr-0f5bc7f88105a5f70              
lifeline-task-sg          lifeline         AWS::EC2::SecurityGroup       sg-037010e17da032dcf               
lifeline-vpc              lifeline         AWS::EC2::VPC                 vpc-043bbacbd0ebea8e5              

Showing 13 of 13 resources (filtered)
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  / managed:true                                                                                     /: edit query
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ↑↓/j/k: navigate  enter: detail  /: search  s: sort  r: refresh  1-4: tab  q: quit                       ?: help
The list shows every managed resource. Above 200 results formae shows the first 200 and asks you to narrow the query. Filter by stack, type, label, or target:
formae inventory opens on the Resources tab, but it is a tabbed view. Press 1-4 to switch between Resources, Targets, Stacks, and Policies, or run a subcommand to jump straight to one. formae inventory stacks opens on Stacks:
  formae inventory
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
                             ╭──────────╮
  1 Resources    2 Targets    3 Stacks    4 Policies 
─────────────────────────────╯          ╰───────────────────────────────────────────────────────────────────────────

Label ▲                   Description                                     Policies                            
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
lifeline                  Stack for the lifeline showcase                 none                                

Showing 1 of 1 stacks
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  /: query
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ↑↓/j/k: navigate  enter: detail  /: search  s: sort  r: refresh  1-4: tab  q: quit                       ?: help
formae inventory targets opens the Targets tab:
  formae inventory
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
                ╭───────────╮
  1 Resources    2 Targets    3 Stacks    4 Policies 
────────────────╯           ╰───────────────────────────────────────────────────────────────────────────────────────

Label ▲                  Namespace             Discoverable    Config                                       
────────────────────────────────────────────────────────────────────────────────────────────────────────────
aws-target               AWS                   yes             Region: us-east-1, Type: AWS                 

Showing 1 of 1 targets
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  /: query
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ↑↓/j/k: navigate  enter: detail  /: search  s: sort  r: refresh  1-4: tab  q: quit                       ?: help

Find and inspect a resource

Search by any attribute, or combine filters:
Type queries are case-insensitive; stack and label values are case-sensitive. To read a resource’s full configuration, extract it to Pkl:

Make a change

Your stack’s forma is the source of truth. To change something, edit the resource in that forma and reconcile: formae compares your forma against what is deployed and applies just the difference. Reconcile is the mode you reach for on routine changes, so run formae apply --mode reconcile. For urgent one-off fixes during an incident, reach for patch instead (see Incidents and recovery).
1

Edit the forma

Change the resource in your stack’s forma. For example, scale a deployment from one replica to two:
2

Apply

formae shows the plan, here a single spec.replicas change, and asks you to confirm before applying. Use --yes to skip the prompt. Reconcile compares against the whole stack, so keep the forma complete: a resource you remove from it is destroyed.

Tear down a stack

To remove everything in a stack, destroy it. formae shows the full deletion plan and asks you to confirm before deleting anything, in dependency order (dependents before their dependencies):
  formae destroy                                                                             query: stack:lifeline
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  - 13 delete

  ▌ Resources
  Operation ▲   Label                                                       Type
  - delete      lifeline-igw                                                AWS::EC2::InternetGateway
  - delete      lifeline-vpc                                                AWS::EC2::VPC
  - delete      lifeline-public-rt                                          AWS::EC2::RouteTable
  - delete      lifeline-igw-attachment                                     AWS::EC2::VPCGatewayAttachment
  - delete      lifeline-task-sg                                            AWS::EC2::SecurityGroup
  - delete      lifeline-alb-sg                                             AWS::EC2::SecurityGroup
  - delete      lifeline-public-route                                       AWS::EC2::Route
  - delete      lifeline-public-subnet-1                                    AWS::EC2::Subnet
  - delete      lifeline-public-subnet-2                                    AWS::EC2::Subnet
  - delete      lifeline-alb-http-ingress                                   AWS::EC2::SecurityGroupIngress
      ↓ show 10 more (3 remaining)

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ↑↓: select  space: expand  →←: column  s: sort  y: confirm  q: abort This operation will delete 13 resource(s).
Do you want to continue? (y/N)  ?: help
Use --yes to skip the confirmation (for scripts). You can also destroy by pointing at the forma: formae destroy my-app.pkl. The stack is removed once its last resource is gone; unmanaged (discovered) resources are untouched.

See also