Full error text was:

Error: Provider configuration not present
To work with module.web_server.module.autoscaling.aws_launch_template.this[0] (orphan) its original provider configuration at module.web_server.provider["registry.terraform.io/hashicorp/aws"] is required, but it has been removed. This occurs when a provider configuration is removed while objects created by that provider still exist in the state. Re-add the provider configuration to destroy module.web_server.module.autoscaling.aws_launch_template.this[0] (orphan), after which you can remove the provider configuration again.

Tried cuing a destroy plan for everything in main.tf, and it still failed with the same error.

I got a similar error when I first created a module named "blog" with "blog.tf" as the main file, and later renamed the main file to "main.tf", which I learnt was more standard.

It now seems to destroy a resource, or all resources, I need to explicitly destroy first, and only later remove the code and commit.

Update: Maybe this only means the provider block should remain in the configuration when everything else is removed?

Update: Yes, yes, yes! Keeping the provider block in the config worked!

When I think about this, it makes perfect sense: the provider allows Terraform to communicate with the cloud provider, so when I removed the provider config, it became unable to reach my cloud provider.

So: to destroy infrastructure in a declarative way, ie. without going to Terraform Cloud -> Cue Destroy Plan, remove the resources from the configuration and make sure to leave the provider block (or file) in place.