Skip to content

Commit f628a15

Browse files
author
Sean Sundberg
authored
Checks for null value for name_prefix (#45)
Signed-off-by: Sean Sundberg <[email protected]>
1 parent 7bfd4bd commit f628a15

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ locals {
33
tmp_dir = "${path.cwd}/.tmp"
44
zone_count = 3
55
vpc_zone_names = [ for index in range(max(local.zone_count, var.address_prefix_count)): "${var.region}-${(index % local.zone_count) + 1}" ]
6-
prefix_name = var.name_prefix != "" ? var.name_prefix : var.resource_group_name
6+
prefix_name = var.name_prefix != "" && var.name_prefix != null ? var.name_prefix : var.resource_group_name
77
vpc_name = lower(replace(var.name != "" ? var.name : "${local.prefix_name}-vpc", "_", "-"))
88
vpc_id = data.ibm_is_vpc.vpc.id
99
security_group_count = var.provision ? 2 : 0

variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ variable "resource_group_id" {
33
type = string
44
description = "The id of the IBM Cloud resource group where the VPC instance will be created."
55
}
6+
67
variable "resource_group_name" {
78
type = string
89
description = "The name of the IBM Cloud resource group where the VPC instance will be created."

0 commit comments

Comments
 (0)