Skip to content

import

Terminal window
agoraform import ADDRESS REMOTE-ID
agoraform import -f path/to/agoraform.yaml ADDRESS REMOTE-ID

agoraform import brings an existing remote resource under Agoraform management without recreating it. It reads the live object, prints deterministic YAML for configurable fields, and persists the provider-native identity in local state.

Import never creates, updates, or deletes the remote resource. It does not rewrite your manifest.

The default manifest path is agoraform.yaml, used only to locate agoraform.state.json. The manifest file itself is not read.

ArgumentDescription
ADDRESSLogical resource address (provider.type.name)
REMOTE-IDProvider-native identity of the existing object

Exactly two arguments are required.

FlagDescription
-f, --filePath to the Agoraform manifest used to locate local state (default agoraform.yaml)
  1. Resolve the provider and resource type from the logical address.
  2. Reject a logical address that already has a state binding.
  3. Read the existing remote resource.
  4. Translate configurable remote fields into Agoraform YAML.
  5. Persist the logical-address → provider-native identity mapping.

Computed and read-only fields are omitted. Provider-native identity is not emitted as a manifest attribute. Secrets never appear in the output.

After you add the generated configuration, agoraform plan against the unchanged remote resource should report no changes.

Terminal window
agoraform import matomo.goal.trial_started 12
agoraform import matomo.variable.user_id VARIABLE_ID
agoraform import matomo.trigger.trial_started TRIGGER_ID
agoraform import matomo.tag.trial_started TAG_ID

Import Tag Manager dependencies before a tag so Agoraform can reconstruct logical $refs. If the fire trigger is not bound, or the remote tag uses an unsupported multi-trigger shape, import fails with guidance instead of emitting Matomo-native IDs as configuration.

Terminal window
agoraform import googleads.conversion_action.trial_started 123456789
agoraform import googleads.customer_conversion_goal.signup SIGNUP~WEBSITE

Conversion actions accept a numeric ID or customers/{customerId}/conversionActions/{id}. Customer conversion goals accept CATEGORY~ORIGIN or customers/{customerId}/customerConversionGoals/{category}~{origin}.

Unsupported conversion types or origins fail with guidance. Import does not emit a conversionAction $ref; add that optionally after import if the matching conversion action is also managed.

CodeMeaning
0Import succeeded
1Import failed
3Invalid invocation (wrong number of arguments or unknown flag)
  • Bulk discovery and interactive selection are out of scope.
  • Related resources are not imported recursively.
  • Existing manifests are not rewritten.