terraform-aws-access/tests/vpc_test.go

29 lines
637 B
Go

package test
import (
"os"
"testing"
"github.com/gruntwork-io/terratest/modules/random"
"github.com/gruntwork-io/terratest/modules/terraform"
)
// this test generates all objects, no overrides
func TestVpc(t *testing.T) {
t.Parallel()
uniqueID := os.Getenv("IDENTIFIER")
if uniqueID == "" {
uniqueID = random.UniqueId()
}
directory := "vpc"
region := "us-west-1"
terraformVars := map[string]interface{}{
"identifier": uniqueID,
}
terraformOptions := setup(t, directory, region, terraformVars)
defer teardown(t, directory)
defer terraform.Destroy(t, terraformOptions)
terraform.InitAndApply(t, terraformOptions)
}