hashicorp/terraform · error

unsupported action

Error message

unsupported action %q

What it means

The built-in 'terraform' provider's PlanAction method returns this error for every action type because the provider declares an empty Actions map (provider.go:80). The switch statement at provider.go:337-340 has only a default case, meaning no ActionType is ever handled. The provider does not support any actions and this is a deliberate stub.

Solutions

  1. Remove any action references targeting the built-in terraform provider from your configuration.
  2. If developing a Terraform extension, register action types in the Actions map of GetProviderSchema and add cases to the PlanAction switch.
  3. Verify the ActionType string in the request matches a provider that actually supports actions.

Example fix

// Extending the provider:
// before
switch req.ActionType {
default:
    resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported action %q", req.ActionType))
}

// after
switch req.ActionType {
case "my_action":
    return planMyAction(req)
default:
    resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported action %q", req.ActionType))
}
Defensive patterns

Strategy: validation

Validate before calling

// Before calling PlanAction, check the provider declares this action type
schema := provider.GetProviderSchema()
if _, ok := schema.Actions[req.ActionType]; !ok {
    // This provider does not support the requested action
    return providers.PlanActionResponse{}
}

Type guard

func isActionSupported(schema providers.GetProviderSchemaResponse, actionType string) bool {
    _, ok := schema.Actions[actionType]
    return ok
}

Prevention

When it happens

Trigger: Calling Provider.PlanAction (provider.go:334-343) with any req.ActionType value. The switch falls through to default immediately. This is reached when Terraform Core attempts to plan an action resource that has been routed to the built-in terraform provider.

Common situations: A Terraform configuration references an action type managed by the built-in 'terraform' provider. Using a custom or experimental Terraform build that invokes PlanAction on this provider. Attempting to use an action feature that has not been implemented for the built-in provider.

Related errors


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

Appendix: source

Thrown at internal/builtin/providers/terraform/provider.go:339

func (p *Provider) GetStates(req providers.GetStatesRequest) providers.GetStatesResponse {
	var resp providers.GetStatesResponse
	resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported state store type %q", req.TypeName))
	return resp
}

func (p *Provider) DeleteState(req providers.DeleteStateRequest) providers.DeleteStateResponse {
	var resp providers.DeleteStateResponse
	resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported state store type %q", req.TypeName))
	return resp
}

func (p *Provider) PlanAction(req providers.PlanActionRequest) providers.PlanActionResponse {
	var resp providers.PlanActionResponse

	switch req.ActionType {
	default:
		resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported action %q", req.ActionType))
	}

	return resp
}

func (p *Provider) InvokeAction(req providers.InvokeActionRequest) providers.InvokeActionResponse {
	var resp providers.InvokeActionResponse

	switch req.ActionType {
	default:
		resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported action %q", req.ActionType))
	}

	return resp
}

func (p *Provider) ValidateActionConfig(req providers.ValidateActionConfigRequest) providers.ValidateActionConfigResponse {
	var resp providers.ValidateActionConfigResponse

View on GitHub (pinned to d32a084675)