terragrunt.hcl 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.9.4"
  11. }
  12. dependency "transit-gateway-hub" {
  13. config_path = "../008-transit-gateway-hub"
  14. }
  15. dependency "interconnect-instances" {
  16. config_path = local.account_vars.locals.interconnect_instances_path
  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. interconnect_public_ips = dependency.interconnect-instances.outputs.public_ips
  33. interconnect_private_ips = dependency.interconnect-instances.outputs.private_ips
  34. transit_gateway_id = dependency.transit-gateway-hub.outputs.tgw_id
  35. }