Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -264,7 +261,7 @@ func TestFullyConfigurableWithFlowLogs(t *testing.T) {
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
{Name: "region", Value: options.Region, DataType: "string"},
{Name: "region", Value: "eu-de", DataType: "string"},
{Name: "resource_tags", Value: options.Tags, DataType: "list(string)"},
{Name: "access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
{Name: "prefix", Value: options.Prefix, DataType: "string"},
Expand All @@ -288,14 +285,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",
Prefix: prefix,
TarIncludePatterns: []string{
"*.tf",
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}

Expand Down