Before you start: the formae agent needs credentials for the account you are
targeting, and you need a formae project (a
PklProject with the schema
dependencies). Starting fresh? Run formae project init, or follow
Write your first forma.- CLI
- AI assistants
1
Declare the target
A target lives in a forma, with a label and a provider The
config. Each
cloud has its own config type, so pick yours:- AWS
- Azure
- GCP
label is how you refer to the target from resources and on the CLI;
config carries the provider settings. Targets are discoverable by
default, which is what lets formae scan them for existing resources. Add
discoverable = false to make a target deploy-only.2
Apply it
formae apply · reconcile target.pkl
────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ 1 create
▌ Targets
Operation ▲ Label
+ create prod-us-west-2
────────────────────────────────────────────────────────────────────────────────────────────────────────────
↑↓: select space: expand →←: column s: sort y: confirm q: abort This operation will create 1
target(s). Do you want to continue? (y/N) ?: help
────────────────────────────────────────────────────────────────────────────────────────────────────────────
+ 1 create
▌ Targets
Operation ▲ Label
+ create prod-us-west-2
────────────────────────────────────────────────────────────────────────────────────────────────────────────
↑↓: select space: expand →←: column s: sort y: confirm q: abort This operation will create 1
target(s). Do you want to continue? (y/N) ?: help
3
Verify
formae inventory
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
╭───────────╮
1 Resources │ 2 Targets │ 3 Stacks 4 Policies
────────────────╯ ╰───────────────────────────────────────────────────────────────────────────────────────────
Label ▲ Namespace Discoverable Config
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
prod-us-west-2 AWS yes Region: us-west-2, Type: AWS
Showing 1 of 1 targets
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
/: query
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
↑↓/j/k: navigate enter: detail /: search s: sort r: refresh 1-4: tab q: quit ?: help
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
╭───────────╮
1 Resources │ 2 Targets │ 3 Stacks 4 Policies
────────────────╯ ╰───────────────────────────────────────────────────────────────────────────────────────────
Label ▲ Namespace Discoverable Config
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
prod-us-west-2 AWS yes Region: us-west-2, Type: AWS
Showing 1 of 1 targets
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
/: query
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
↑↓/j/k: navigate enter: detail /: search s: sort r: refresh 1-4: tab q: quit ?: help
See also
- Target: what a target is and how it relates to stacks and resources.
- Discovery: how formae finds existing resources once a target is discoverable.
- Bring resources under management: adopt what discovery finds.

