diff --git a/tests/pr_test.go b/tests/pr_test.go index 2868c47f..260fb03d 100644 --- a/tests/pr_test.go +++ b/tests/pr_test.go @@ -201,14 +201,11 @@ func TestFullyConfigurable(t *testing.T) { require.True(t, present, checkVariable+" environment variable not set") require.NotEqual(t, "", val, checkVariable+" environment variable is empty") - // Programmatically determine region to use based on availability - region, _ := testhelper.GetBestVpcRegion(val, "../common-dev-assets/common-go-assets/cloudinfo-region-vpc-gen2-prefs.yaml", "eu-de") - prefix := "vpc-da" options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{ Testing: t, - Region: region, + Region: "eu-de", Prefix: prefix, TarIncludePatterns: []string{ "*.tf", @@ -248,6 +245,7 @@ func TestFullyConfigurableWithFlowLogs(t *testing.T) { options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{ Testing: t, + Region: "eu-de", // Hardcoding region to avoid jp-osa, as jp-osa does not support COS association with HPCS. Prefix: prefix, TarIncludePatterns: []string{ "*.tf", @@ -288,14 +286,11 @@ func TestRunUpgradeFullyConfigurable(t *testing.T) { require.True(t, present, checkVariable+" environment variable not set") require.NotEqual(t, "", val, checkVariable+" environment variable is empty") - // Programmatically determine region to use based on availability - region, _ := testhelper.GetBestVpcRegion(val, "../common-dev-assets/common-go-assets/cloudinfo-region-vpc-gen2-prefs.yaml", "eu-de") - prefix := "vpc-upg" options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{ Testing: t, - Region: region, + Region: "eu-de", // Hardcoding region to avoid jp-osa, as jp-osa does not support COS association with HPCS. Prefix: prefix, TarIncludePatterns: []string{ "*.tf", diff --git a/variables.tf b/variables.tf index 71d5eed9..ce79b4a4 100644 --- a/variables.tf +++ b/variables.tf @@ -13,8 +13,8 @@ variable "create_vpc" { } validation { - condition = !(var.create_vpc == false && var.create_subnets == true) - error_message = "You cannot create subnets without creating a VPC. Hence if 'create_vpc' is false, then 'create_subnets' can not be true." + condition = !(var.create_vpc == true && var.create_subnets == false) + error_message = "You must create subnets while creating a VPC. Hence if 'create_vpc' is true, then 'create_subnets' should be true." } }