apply
agoraform applyagoraform apply -f path/to/manifest.yamlagoraform apply path/to/manifest.yamlPurpose
Section titled “Purpose”agoraform apply builds the same reviewed convergence plan as agoraform plan and executes it in deterministic order. Creates and updates run sequentially in prerequisite-first order. apply never deletes remote resources.
The default manifest path is agoraform.yaml.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
[file] | Optional positional path to the manifest. At most one argument. |
Specify a manifest as an argument or with --file, not both.
| Flag | Description |
|---|---|
-f, --file | Path to the Agoraform manifest (default agoraform.yaml) |
Expected behavior
Section titled “Expected behavior”- Load and validate the manifest, including provider-specific non-secret desired state, the resource dependency graph, and local identity state.
- Apply resource creates and updates.
$refvalues are resolved immediately before mutation. - Persist identity bindings to
agoraform.state.json. Failed mutations do not create new bindings. - Execute provider finalization actions that appeared in the plan only after all planned resource mutations and required state writes succeed.
For updates, apply re-reads the exact identity-bound remote object immediately before mutation so providers can preserve unmanaged fields.
Output
Section titled “Output”Resource-only apply:
matomo.goal.trial_started: creating...matomo.goal.trial_started: created
Apply complete! 1 created, 0 updated.With declarative Matomo publication:
matomo.tag.trial_started: updating...matomo.tag.trial_started: updatedmatomo.container.main: version 12 createdmatomo.container.main: published to live
Apply complete! 0 created, 1 updated, 1 provider action completed.A conditional finalization that becomes unnecessary after resource convergence still reports that decision:
matomo.container.main: no publication required
Apply complete! 0 created, 1 updated, 1 provider action completed.A zero-action apply prints:
Apply complete! 0 created, 0 updated.Failure behavior
Section titled “Failure behavior”Apply stops at the first resource or state-write failure. Provider finalization is not attempted after that.
If version creation succeeds but publication fails, apply prints the created version detail before returning a partial-convergence failure. Earlier resource changes remain applied.
Incomplete apply still exits 1. Rollback and transactions are out of scope.
Recovery
Section titled “Recovery”If a create succeeds and the state file cannot be written, fix the file, then re-bind:
matomo.variable.user_id was created remotely with id 12, but its state binding could not be saved.Fix the state-file problem, then run: agoraform import matomo.variable.user_id 12Do not import the same identity onto a second address. A later unchanged plan does not repair the missing binding.
If an update succeeds and the state file cannot be written, the existing identity is normally still valid. Fix the file and rerun plan/apply.
If Matomo returns HTTP 200 but the publish body is empty, JSON null, unreadable, or otherwise unconfirmed, inspect the remote container before retrying. Retrying immediately can snapshot another unused version.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | Apply succeeded |
1 | Apply failed |
3 | Invalid invocation |
Caveats
Section titled “Caveats”- There is no
destroycommand. - Provider secrets are not written to output or local state.
- Destructive deletion, rollback, and parallel mutation are not implemented.