terragrunt.hcl 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. locals {
  2. environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
  3. partition_vars = read_terragrunt_config(find_in_parent_folders("partition.hcl"))
  4. region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
  5. account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
  6. global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
  7. }
  8. terraform {
  9. # Double slash is intentional and required to show root of modules
  10. source = "git@github.mdr.defpoint.com:mdr-engineering/xdr-terraform-modules.git//base/transit-gateway-interconnect-vpn?ref=v0.3.1"
  11. }
  12. dependency "transit-gateway-hub" {
  13. config_path = "../008-transit-gateway-hub"
  14. }
  15. dependency "xdr-interconnect-instances" {
  16. config_path = "../018-xdr-interconnect-instances"
  17. }
  18. # Include all settings from the root terragrunt.hcl file
  19. include {
  20. path = find_in_parent_folders()
  21. }
  22. # These are the variables we have to pass in to use the module specified in the terragrunt source above
  23. inputs = {
  24. # All of the inputs from the inherited hcl files are available automatically
  25. # (via the `inputs` section of the root `terragrunt.hcl`). However, modules
  26. # will be more flexible if you specify particular input values.
  27. name = "${local.partition_vars.locals.aws_partition_alias}-${local.environment_vars.locals.environment}"
  28. tags = {
  29. Purpose = "Transit Gateway VPN"
  30. Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
  31. }
  32. xdr_interconnect_public_ips = dependency.xdr-interconnect-instances.outputs.public_ips
  33. transit_gateway_id = dependency.transit-gateway-hub.outputs.tgw_id
  34. }