Terraform Test error is unclear when you hit service quota during build phase

Part of my Terraform Test builds a bunch of VPCs. I get an irrelevant error message when I hit VPC service limit:

│ Error: Failed to clean up after tests
│ Due to errors during destroy, test suite "examples_formatted_tags" has left behind an object for aws_vpc.test_aws_to_aws. You will need to delete this object manually in the remote system, or else it may have an ongoing cost.

In this situation, the VPC never actually built (despite the error text) because I had hit the service quota in that region

side q - do you want “bugs” like this in discuss.hashicorp.com or as a github issue in github.com/hashicorp/terraform ? If on discuss, perhaps we could get a category for Terraform Test?

Hi @drewmullen1! Thanks for reporting this.

I’m not sure we have a general rule to follow her since there is a murky line between a bug report and general conceptual feedback on a feature, but this particular case does seem like a clear bug: Terraform is reporting that something exists in the state but it doesn’t exist in the remote system.

So for this one I think it would be best to go through the usual bug report process so that (via our issue template questions) we can gather hopefully enough extra context to understand where the root cause is for this oddity.

My first guess would’ve been that something got confused during create and we ended up with a (possibly-tainted) VPC recorded in the state even though it didn’t actually exist, but I’m not sure how a VPC that doesn’t exist would be recorded in the state because it wouldn’t have a VPC ID to save, and so I have to assume there’s something else going on here that we won’t understand fully without some more detailed debugging.

Thanks again!

ill do a few more tests to validate my root cause analysis then open up an issue on terraform core

thanks, martin!

just to follow up: Terraform Test error is unclear when you hit service quota during build phase · Issue #30066 · hashicorp/terraform · GitHub