Terraform .tfvars cast decoding error

I'm trying to set up something really simple with Terraform, but it gives me an error I haven't seen before. When I run terraform validate -var-file=secrets.tfvars I get the following error: Error...

How do I create an API Proxy using Terraform and AWS API Gateway

I am trying to use Terraform to be able to stand up a simple API Proxy in API Gateway on AWS. Basically, I want to wrap root and proxy the requests back to another end point. Its probably the...

how to delete compute engine vm using terraform

I have a temporary VM created in GCP using terraform google_compute_instance module.. this VM has a startup script that will execute a bunch of activities.. at the very end of the script there is...

How to override remote state in Terratest Terraform setup

I'm trying to understand how to override the Terraform backend ( in my case remote state ) and use local state when setting up Terratest Terraform test. I am using Terratest to test some Terraform...

Implement replacement for "terraform.ReadPlan is no longer in use"

Microsoft provides an example for testing Terraform infrastructure using Terratest: https://docs.microsoft.com/en-us/azure/terraform/terratest-in-terraform-modules There is an interesting part of...

Helm Test best practices

Just to clarify. I am not talking about Helm chart best practices. I can read them by myself over here: https://helm.sh/docs/chart_best_practices/ I am not talking about Terratest. I am...

how to pass an assume role in terratest

I'm working on writing test case for a terraform module. I have an assume role, and i would like to pass it to my go test. I'm not sure how to pass it . I defined it as a const and then how should...

Terratest - Use mock AWS services

I am trying to do AWS resource provisioning through terraform and planning to have a CICD pipeline with terratest unit test cases for the terraform code. My problem is I have CloudFront in my...

Is there a way to run terratest on terraform codes in azure devops pipelines?

I am a beginner in the terratesting. I have an assignment where I have to perform terratesting for InfraStructure code that I wrote in terraform. I went through the documentation...

Terratest does not find terraform on Mac

I am trying to write a simple go test as follows import ( "testing" "github.com/gruntwork-io/terratest/modules/terraform" "github.com/stretchr/testify/assert" ) func...

Terratest throws error on assertions on errors

Hello I have the following test func badTags(t *testing.T){ terraformOptions := &terraform.Options{ TerraformDir: "../bad_values", } tags := terraform.Output(t, terraformOptions,...

Golang Parse Output to Read a Key (terraform output)

I have been trying to parse terraform output for terratest assertions The output from running terratest is result := `[{ "id": "/addressPools/test-pool" "name" : "test-pool" }]` Note...

Terraform list object in Golang

I am trying to represent Terraform list of objects in Go i.e. variable "map_roles" { description = "Additional IAM roles to add to the aws-auth configmap." type = list(object({ rolearn =...

Terratest multiple targets

I am using terrates to test my terraform code. My code have 2 modules so I managed to configure terratest to use target option while configuring the terraformOptions and it creates both...

Go get all dependencies returns unrecognized import path for Terratest

Configuration go1.15.2 darwin/amd64 macOS Catalina v10.15.7 .zshrc file export GOPATH=$HOME/go export GOROOT=/usr/local/opt/go/libexec export PATH=$PATH:$GOPATH/bin export...

terratest assert.Equal not matching, can you get them to match?

I'm new to writing terratest go tests. I have a simple test, where I want to check the VMSize, to make sure it has the correct size. The function azure.GetSizeOfVirtualMachine() fetchs the value...

How to call Terragrunt HCL files from Terratest Go script?

I have a terragrunt script which is working fine after running terragrunt apply-all command line but same thing i am not able to do/invoke form Go script. using TgApplyAll function Below is my Go...

How can I load my AWS EC2 Key pair PEM file to my terratest script to perform AWS EC2 SSH connection validation

I am writing Go terratest script to validate SSH connection for AWS EC2 instance I already have AWS EC2 keypair PEM file in my local I am able to launch and destroy EC2 instance using...

Azure Keyvault purging issues

I have a simple regression test for my Terraform infrastructure. This Terraform infrastructure consists of many resources including an Azure Keyvault. As it becomes the default for Azure Keyvault...

Using terratest with a separate backend.hcl file

I am using terratest successfully, but since switching to a remote backend, where the details are defined in a separate backend.hcl file, I am running into trouble. The situation: my main.tf...

Azure pipeline - terratest - ERROR: Please run 'az login' to setup account

i'm facing a (it seams) recurent pbm in Azure Pipeline to run terratest. While resources are well created the destroyed, when I call an azure.ResourceGroupExists function (or whatever else...

Run Terraform as a Go Library?

I've been using Terratest to test all my go modules and absolutely love it as a means for running terraform and interacting with terraform infrastructure through the go programming language....

Azure Api management purge

I guys, I am running some test with terraform and terratest, I created a API Management and deleted it, but I didn't realised that APIM has soft delete enabled by default, and now I can't create...