28 lines
606 B
Go
28 lines
606 B
Go
package test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/gruntwork-io/terratest/modules/random"
|
|
"github.com/gruntwork-io/terratest/modules/terraform"
|
|
)
|
|
|
|
func TestLoadbalancer(t *testing.T) {
|
|
t.Parallel()
|
|
uniqueID := os.Getenv("IDENTIFIER")
|
|
if uniqueID == "" {
|
|
uniqueID = random.UniqueId()
|
|
}
|
|
directory := "loadbalancer"
|
|
region := "us-west-2"
|
|
|
|
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)
|
|
}
|