terraform-plugin-sdk
terraform-plugin-sdk copied to clipboard
Ability to Pre-provision Resources for Acceptance Tests
SDK version
v2.10.1
Use-cases
I'm working on acceptance tests on a TF provider for an application that leverages aws resources. I'm trying to provision ephemeral aws resources prior to my TF provider's acceptance tests running against my service. These resources would be destroyed at the end of the testing cycle.
Attempted Solutions
Common solution appears to be writing terraform, applying it, then running the acceptance testing. For ex: https://github.com/hashicorp/terraform-provider-kubernetes/tree/main/kubernetes/test-infra
Proposal
Given that we can add ExternalProviders to acceptance testing, would we also be able to leverage these to create external resources? Much like how you can PreCheck dependencies for acceptance tests, I'd like to be able to PreCheck or PreProvision cloud dependencies that would allow for my acceptance tests to run. Here we would get the ability to keep test infrastructure localized in one testing suite, while being able to perform validation or pass along data regarding infrastructure to your acceptance testing.