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
- Remove any action references targeting the built-in terraform provider from your configuration.
- If developing a Terraform extension, register action types in the Actions map of GetProviderSchema and add cases to the PlanAction switch.
- 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
- Check GetProviderSchema().Actions is non-empty and contains the action type before calling PlanAction.
- Do not route action planning to providers that declare an empty Actions map.
- In Terraform Core routing, validate action type against the provider schema before dispatching.
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
- action has config values with unsupported marks
- action has ephemeral config values, which are not supported…
- error in marshaling deferred action invocations
- error marshaling action invocations
- failed to decode action
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.ValidateActionConfigResponseView on GitHub (pinned to d32a084675)