Skip to content

apply

Terminal window
agoraform apply
agoraform apply -f path/to/manifest.yaml
agoraform apply path/to/manifest.yaml

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.

ArgumentDescription
[file]Optional positional path to the manifest. At most one argument.

Specify a manifest as an argument or with --file, not both.

FlagDescription
-f, --filePath to the Agoraform manifest (default agoraform.yaml)
  1. Load and validate the manifest, including provider-specific non-secret desired state, the resource dependency graph, and local identity state.
  2. Apply resource creates and updates. $ref values are resolved immediately before mutation.
  3. Persist identity bindings to agoraform.state.json. Failed mutations do not create new bindings.
  4. 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.

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: updated
matomo.container.main: version 12 created
matomo.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.

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.

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 12

Do 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.

CodeMeaning
0Apply succeeded
1Apply failed
3Invalid invocation
  • There is no destroy command.
  • Provider secrets are not written to output or local state.
  • Destructive deletion, rollback, and parallel mutation are not implemented.