terratest icon indicating copy to clipboard operation
terratest copied to clipboard

Dynamically set module version in terratest

Open maha51ece-tech opened this issue 2 years ago • 1 comments

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",
	},
	
})

maha51ece-tech avatar Aug 13 '23 13:08 maha51ece-tech

I usually use https://github.com/minamijoyo/hcledit for things like this.

skyzyx avatar Oct 31 '23 22:10 skyzyx