terratest icon indicating copy to clipboard operation
terratest copied to clipboard

using terratest in existing infrastructure in staging or production

Open imtiaz2564 opened this issue 2 years ago • 1 comments

Can terratest be used in existing infrastructure in staging or production ? If yes, should we use InitAndApply and Destroy function ? Because, InitAndApply, Initialize and Apply Terraform Configurations what already exists Destroy, delete the resources.

Should we only use when there are some changes?

imtiaz2564 avatar Nov 16 '23 20:11 imtiaz2564

You should not use it with either.

Well-designed Terraform code is modular, fully-automated, and should empower the creation of ephemeral environments that can be easily created/destroyed.

Terratest can help you validate that your Terraform code does what you think it does — just like automated testing in software development — by running independently of any of your existing environments. Maybe run them from a PR/branch instead of your default branch which should represent what you have deployed to live environments.

skyzyx avatar Dec 18 '23 04:12 skyzyx