hashicorp/terraform · error

unsupported action trigger type: %T

Error message

unsupported action trigger type: %T

What it means

Default branch of the type switch over action.ActionTrigger: the concrete type is neither *plans.ResourceActionTrigger nor *plans.InvokeActionTrigger. This means the plan contains a trigger kind this Terraform version does not know how to render.

Solutions

  1. Upgrade Terraform to a version that recognizes the trigger type shown by %T.
  2. Regenerate the plan with the current Terraform version.
  3. If developing a new trigger type, add a case for it to the type switch in MarshalActionInvocation.
Defensive patterns

Strategy: type-guard

Type guard

func knownActionTrigger(t plans.ActionTrigger) bool {
    switch t.(type) {
    case *plans.ResourceActionTrigger, *plans.InvokeActionTrigger:
        return true
    default:
        return false
    }
}

Prevention

When it happens

Trigger: Plan produced by a newer Terraform that added a new action trigger variant; custom/forked plans with non-standard trigger types; serialized plans deserialized into an unexpected concrete type.

Common situations: See trigger scenarios.

Related errors


AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11). Data as JSON: /api/errors/5f0919250c9cd909. Report an issue: GitHub.

Appendix: source

Thrown at internal/command/jsonplan/action_invocations.go:150

		return ai, fmt.Errorf("failed to decode action %s: %w", action.Addr, err)
	}

	switch at := action.ActionTrigger.(type) {
	case *plans.ResourceActionTrigger:
		ai.LifecycleActionTrigger = &LifecycleActionTrigger{
			TriggeringResourceAddress: at.TriggeringResourceAddr.String(),
			ActionTriggerEvent:        at.TriggerEvent().String(),
			ActionTriggerBlockIndex:   at.ActionTriggerBlockIndex,
			ActionsListIndex:          at.ActionsListIndex,
			OnFailure:                 at.ActionOnFailure.String(),
		}
	case *plans.InvokeActionTrigger:
		ai.InvokeActionTrigger = &InvokeActionTrigger{}
		if at.CallingResourceAddr != nil {
			ai.InvokeActionTrigger.CallingResourceAddress = at.CallingResourceAddr.String()
		}
	default:
		return ai, fmt.Errorf("unsupported action trigger type: %T", at)
	}

	var config []byte
	var sensitive []byte
	var unknown []byte

	if actionDec.ConfigValue != cty.NilVal {
		unmarkedValue, pvms := actionDec.ConfigValue.UnmarkDeepWithPaths()
		sensitivePaths, otherMarks := marks.PathsWithMark(pvms, marks.Sensitive)
		ephemeralPaths, otherMarks := marks.PathsWithMark(otherMarks, marks.Ephemeral)
		if len(ephemeralPaths) > 0 {
			return ai, fmt.Errorf("action %s has ephemeral config values, which are not supported in action invocations", action.Addr)
		}
		if len(otherMarks) > 0 {
			return ai, fmt.Errorf("action %s has config values with unsupported marks: %v", action.Addr, otherMarks)
		}

		unknownValue := unknownAsBool(unmarkedValue)

View on GitHub (pinned to d32a084675)