How do you test against multiple provider versions?
IntermediateProductionTesting and Policy as Code
Answer
Run the module's test suite in a CI matrix with the minimum supported provider version (the lower bound in required_providers) and the latest, using terraform init -upgrade for latest and a lock file for the minimum. It catches the case where you used an argument introduced after your stated lower bound.
More on Testing and Policy as Code
How do you test infrastructure code, and what does the testing pyramid look like?BeginnerWhat does the static-analysis layer catch?BeginnerWhat does tflint do, and how is it configured?BeginnerHow do Checkov and Trivy differ?IntermediateHow does `terraform test` work?BeginnerHow do mock providers work in `terraform test`?Advanced