Skip to content

Commit 74cfa73

Browse files
authored
test: add prefix to vpc name to avoid name clash (#1067)
1 parent 57eff29 commit 74cfa73

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

examples/no-prefix/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module "slz_vpc" {
3838
source = "../../"
3939
resource_group_id = module.resource_group.resource_group_id
4040
region = var.region
41-
name = "vpc"
41+
name = var.vpc_name
4242
routing_table_name = "vpc-routing-table"
4343
public_gateway_name = "vpc-public-gateway"
4444
vpc_flow_logs_name = "vpc-flow-logs"

examples/no-prefix/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ variable "access_tags" {
3131
description = "Optional list of access tags to add to the VPC resources that are created"
3232
default = []
3333
}
34+
35+
variable "vpc_name" {
36+
type = string
37+
description = "Name of the VPC"
38+
default = "vpc"
39+
}

tests/pr_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func TestRunNoPrefixExample(t *testing.T) {
9494
t.Parallel()
9595

9696
options := setupOptions(t, "no-prefix-lz", noprefixExampleTerraformDir)
97+
options.TerraformVars["vpc_name"] = fmt.Sprintf("%s-vpc", options.Prefix)
9798

9899
output, err := options.RunTestConsistency()
99100
assert.Nil(t, err, "This should not have errored")

0 commit comments

Comments
 (0)