Difference between revisions of "Terragrunt.hcl"

From wikieduonline
Jump to navigation Jump to search
Line 4: Line 4:
 
  [[find_in_parent_folders]]
 
  [[find_in_parent_folders]]
  
 +
 +
== Examples ==
 +
 +
include {
 +
  path = find_in_parent_folders()
 +
}
 +
<pre>
 +
generate "remote_states" {
 +
  path      = "tg_remote_states.tf"
 +
  if_exists = "overwrite"
 +
  contents = templatefile("../../../remote-states.tmpl",
 +
  {
 +
    remote_states = [
 +
      {
 +
        "name" = "vpc"
 +
        "bucket" = "${get_env("AWS_SESSION_NAME")}-state-storage"
 +
        "key" = "terraform/${get_env("AWS_SESSION_NAME")}/${get_env("AWS_ENV")}-vpc"
 +
      }
 +
    ]
 +
  })
 +
}
 +
</pre>
  
 
== See also ==
 
== See also ==
* {{Terragrunt}}
+
* {{terragrunt}}
  
 
[[Category:Terragrunt]]
 
[[Category:Terragrunt]]

Revision as of 06:07, 13 March 2023

https://terragrunt.gruntwork.io/docs/reference/built-in-functions/#find_in_parent_folders

find_in_parent_folders


Examples

include {
  path = find_in_parent_folders()
}
 
generate "remote_states" {
  path      = "tg_remote_states.tf"
  if_exists = "overwrite"
  contents = templatefile("../../../remote-states.tmpl",
  {
    remote_states = [
      {
        "name" = "vpc"
        "bucket" = "${get_env("AWS_SESSION_NAME")}-state-storage"
        "key" = "terraform/${get_env("AWS_SESSION_NAME")}/${get_env("AWS_ENV")}-vpc"
      }
    ]
  })
}

See also

Advertising: