[Bedrock] Update Bedrock Integration tests to have terraform commands and terratest script separate
As a: Developer
I want: Decoupling of Terraform commands from the Bedrock terratest integration scripts
So that: I can know when an integration test fails during deployment of resources, interoperability of resources, and deletion of resources.
Describe the solution you'd like: Terratest scripts should no longer directly call terraform commands, this should be handled by the pipeline yaml in separate steps. In addition, variable configurations should be passed between steps from successful terraform apply to the terratest validation.
Acceptance Criteria:
- [ ] Decouple terraform init, plan, apply and destroy to separate steps in a template pipeline
- [ ] Pass terraform configuration once successfully applied to terratest script
- [ ] Build logic that surfaces cloud shell failures vs script failures
Additional context: Task of https://github.com/microsoft/bedrock/issues/964
Does this require updates to documentation?: Yes
Steps:
- Export Env Vars to map
- Create a Resource Group
- Copy to temporary infra folder
- Export map with TF config
- Terraform init
- Terraform plan
- Terraform Apply
- Run terratest integration tests
- Delete resources
- Related to: #1424