terratest
terratest copied to clipboard
Dynamically set module version in terratest
Hi Team, Is there a way we can dynamically set a "version" field in the module available in terraform configuration file similar to
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../fixtures/cloud_storage",
// Reconfigure: true,
Vars: map[string]interface{}{
"project_id": projectId,
"name": fmt.Sprintf("bucket-asd-"+environment+"-encryption-testauto"),
"location": location,
"storage_class": "STANDARD",
"force_destroy": true,
"additional_labels": labels["ap1"],
"uniform_bucket_level_access": true,
"keynames": kmsKeyId,
},
VarFiles: []string{
"common_cloud_storage.tfvars",
},
})
I usually use https://github.com/minamijoyo/hcledit for things like this.