Rewrite terragrunt files into canonical format so they pass validation 08/112608/2
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Mon, 14 Sep 2020 10:40:45 +0000 (12:40 +0200)
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>
Tue, 15 Sep 2020 07:24:46 +0000 (07:24 +0000)
Change-Id: I3e748f0027429c2ee384467d9d61c1a87cce8fc3
Issue-ID: INT-1713
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
terragrunt/openlab/RegionOne/stage/env.hcl
terragrunt/openlab/account.hcl
terragrunt/openlab/terragrunt.hcl

index b3208c8..cb68eb2 100644 (file)
@@ -1,14 +1,14 @@
 # Set common variables for the environment. This is automatically pulled in in the root terragrunt.hcl configuration to
 # feed forward to the child modules.
 locals {
-  environment        = ""  # name of the environment you use. e.g stage, prod or qa
-  network            = ""  # name of the network to connect with the Internet
+  environment = "" # name of the environment you use. e.g stage, prod or qa
+  network     = "" # name of the network to connect with the Internet
 
   # Rancher and Kubernetes
   # To access a VM, 'ssh -i ssh_private_key_path kubernetes_user@one-of-the-external-ips'
   # a key pair for accessing VMs
-  ssh_public_key       = ""  # OpenSSH formated string is required
-  ssh_private_key_path = ""  # e.g ~/.ssh/id_rsa
+  ssh_public_key       = "" # OpenSSH formated string is required
+  ssh_private_key_path = "" # e.g ~/.ssh/id_rsa
 
   kubernetes_version      = "v1.15.11-rancher1-2"
   kubernetes_user         = "ubuntu"
index 19d1b8c..27c5cf0 100644 (file)
@@ -2,10 +2,10 @@
 # terragrunt.hcl configuration.
 # For Openstack, please fill in the values below
 locals {
-  user_name  = "${get_env("user_name", "")}"   # Expose environmental variables for your account
-  password   = "${get_env("password", "")}"
-  project_id = "${get_env("project_id", "")}"
-  auth_url   = "${get_env("auth_url","")}"
-  backend    = ""   # Remote state backend. gcs for google or s3 for Amazon
+  user_name     = "${get_env("user_name", "")}" # Expose environmental variables for your account
+  password      = "${get_env("password", "")}"
+  project_id    = "${get_env("project_id", "")}"
+  auth_url      = "${get_env("auth_url", "")}"
+  backend       = "" # Remote state backend. gcs for google or s3 for Amazon
   backend_state = "" # GCP storage bucket or AWS S3
 }
index 7c55ea3..c97b495 100644 (file)
@@ -9,14 +9,14 @@ locals {
   environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
 
   # Extract the variables we need for easy access
-  user_name    = local.account_vars.locals.user_name
-  password     = local.account_vars.locals.password
-  auth_url     = local.account_vars.locals.auth_url
-  project_id   = local.account_vars.locals.project_id
-  backend      = local.account_vars.locals.backend
+  user_name     = local.account_vars.locals.user_name
+  password      = local.account_vars.locals.password
+  auth_url      = local.account_vars.locals.auth_url
+  project_id    = local.account_vars.locals.project_id
+  backend       = local.account_vars.locals.backend
   backend_state = local.account_vars.locals.backend_state
-  region       = local.region_vars.locals.region
-  environment  = local.environment_vars.locals.environment
+  region        = local.region_vars.locals.region
+  environment   = local.environment_vars.locals.environment
 }
 
 remote_state {
@@ -28,16 +28,16 @@ remote_state {
   }
 
   config = {
-    bucket      = "${local.backend_state}"
-    prefix      = "${path_relative_to_include()}/terraform.tfstate"
+    bucket = "${local.backend_state}"
+    prefix = "${path_relative_to_include()}/terraform.tfstate"
   }
 }
 
 # test/terragrunt.hcl
 generate "provider" {
-  path = "provider.tf"
+  path      = "provider.tf"
   if_exists = "overwrite_terragrunt"
-  contents = <<EOF
+  contents  = <<EOF
 provider "openstack" {
   user_name   = "${local.user_name}"
   tenant_name = "${local.user_name}"
@@ -58,7 +58,7 @@ EOF
 # Configure root level variables that all resources can inherit. This is especially helpful with multi-account configs
 # where terraform_remote_state data sources are placed directly into the modules.
 inputs = merge(
-local.account_vars.locals,
-local.region_vars.locals,
-local.environment_vars.locals,
+  local.account_vars.locals,
+  local.region_vars.locals,
+  local.environment_vars.locals,
 )