diff --git a/environments/modules/grafana_dashboard/locals.tf b/environments/modules/grafana_dashboard/locals.tf index d980d1e..7fd79c1 100644 --- a/environments/modules/grafana_dashboard/locals.tf +++ b/environments/modules/grafana_dashboard/locals.tf @@ -7,11 +7,11 @@ locals { file_path = "${group.dashboard_path_if_exist}/${file}" dashboard_json = jsondecode(file("${group.dashboard_path_if_exist}/${file}")) dashboard_uid = substr( - regexreplace( + replace( lower( "${try(jsondecode(file("${group.dashboard_path_if_exist}/${file}")).uid, trimsuffix(basename(file), ".json"))}_${group.dashboard_path_if_exist}/${file}" ), - "[^a-z0-9_-]", + "/[^a-z0-9_-]/", "_" ), 0, @@ -32,11 +32,11 @@ locals { file_path = "${group.dashboard_path_if_exist}/${file}" dashboard_json = jsondecode(file("${group.dashboard_path_if_exist}/${file}")) dashboard_uid = substr( - regexreplace( + replace( lower( "${try(jsondecode(file("${group.dashboard_path_if_exist}/${file}")).uid, trimsuffix(basename(file), ".json"))}_${group.dashboard_path_if_exist}/${file}" ), - "[^a-z0-9_-]", + "/[^a-z0-9_-]/", "_" ), 0, @@ -57,11 +57,11 @@ locals { file_path = "${group.dashboard_path_if_exist}/${file}" dashboard_json = jsondecode(file("${group.dashboard_path_if_exist}/${file}")) dashboard_uid = substr( - regexreplace( + replace( lower( "${try(jsondecode(file("${group.dashboard_path_if_exist}/${file}")).uid, trimsuffix(basename(file), ".json"))}_${group.dashboard_path_if_exist}/${file}" ), - "[^a-z0-9_-]", + "/[^a-z0-9_-]/", "_" ), 0, @@ -82,11 +82,11 @@ locals { file_path = "${group.dashboard_path_if_exist}/${file}" dashboard_json = jsondecode(file("${group.dashboard_path_if_exist}/${file}")) dashboard_uid = substr( - regexreplace( + replace( lower( "${try(jsondecode(file("${group.dashboard_path_if_exist}/${file}")).uid, trimsuffix(basename(file), ".json"))}_${group.dashboard_path_if_exist}/${file}" ), - "[^a-z0-9_-]", + "/[^a-z0-9_-]/", "_" ), 0,