terragrunt.hcl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. locals {
  2. # If you want to use any of the variables in _this_ file, you have to load them here.
  3. # However, they will all be available as inputs to the module loaded in terraform.source
  4. # below.
  5. environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
  6. partition_vars = read_terragrunt_config(find_in_parent_folders("partition.hcl"))
  7. region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
  8. account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
  9. global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
  10. }
  11. # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
  12. # working directory, into a temporary folder, and execute your Terraform commands in that folder.
  13. terraform {
  14. # Double slash is intentional and required to show root of modules
  15. source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/vault-configuration?ref=v4.2.11"
  16. }
  17. dependency "vpc-system-services" {
  18. config_path = "../010-vpc-system-services"
  19. }
  20. dependency "instance-vault" {
  21. config_path = "../090-instance-vault"
  22. }
  23. #Vault specific provider
  24. generate "vault-provider" {
  25. path = "vault-provider.tf"
  26. if_exists = "overwrite_terragrunt"
  27. contents = <<EOF
  28. #Provider block for Vault.
  29. provider "vault" {
  30. address = "https://${dependency.instance-vault.outputs.vault_alb_address}"
  31. skip_tls_verify = true
  32. }
  33. EOF
  34. }
  35. # Include all settings from the root terragrunt.hcl file
  36. include {
  37. path = find_in_parent_folders()
  38. }
  39. # These are the variables we have to pass in to use the module specified in the terragrunt source above
  40. inputs = {
  41. # All of the inputs from the inherited hcl files are available automatically
  42. # (via the `inputs` section of the root `terragrunt.hcl`). However, modules
  43. # will be more flexible if you specify particular input values.
  44. tags = {
  45. Purpose = "Vault"
  46. Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
  47. }
  48. instance_name = "vault"
  49. instance_type = local.account_vars.locals.vault_server_instance_type
  50. vpc_id = dependency.vpc-system-services.outputs.vpc_id
  51. azs = dependency.vpc-system-services.outputs.azs
  52. subnets = dependency.vpc-system-services.outputs.private_subnets
  53. roles = {
  54. mdr-admins = {
  55. token_policies = ["admins"]
  56. bound_groups = ["mdr-admins"]
  57. }
  58. mdr-engineers = {
  59. token_policies = ["engineers"]
  60. bound_groups = ["mdr-engineers"]
  61. }
  62. phantom-role-administrator = {
  63. token_policies = ["phantom"]
  64. bound_groups = ["phantom-role-administrator"]
  65. }
  66. vault-admins = {
  67. token_policies = ["admins"]
  68. bound_groups = ["vault-admins"]
  69. }
  70. analyst-shift-lead = {
  71. token_policies = ["soc"]
  72. bound_groups = ["analyst-shift-lead"]
  73. }
  74. analyst-tier-3 = {
  75. token_policies = ["soc"]
  76. bound_groups = ["analyst-tier-3"]
  77. }
  78. }
  79. }
  80. terraform_version_constraint = "= 1.1.6"
  81. terragrunt_version_constraint = "= 0.36.2"