Skip to content

Commit

Permalink
Handle a case that the base directory variable is null
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf13 committed Oct 15, 2023
1 parent 191ff4d commit c91c59d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/aws/sonar-base-instance/userdata.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ locals {

instance_address = var.use_public_ip ? local.public_ip : local.private_ip
display_name = var.name
sonar_base_directory = var.base_directory != null ? var.base_directory : ""

script_path = var.terraform_script_path_folder == null ? null : (join("/", [var.terraform_script_path_folder, "terraform_%RAND%.sh"]))
install_script = templatefile("${path.module}/setup.tftpl", {
Expand All @@ -20,7 +21,7 @@ locals {
jsonar_uuid = random_uuid.jsonar_uuid.result
additional_install_parameters = var.additional_install_parameters
access_tokens_array = local.access_tokens_array
base_directory = var.base_directory
base_directory = local.sonar_base_directory
})
}

Expand Down

0 comments on commit c91c59d

Please sign in to comment.