terragrunt.hcl 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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=v5.0.0"
  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. vpc_id = dependency.vpc-system-services.outputs.vpc_id
  50. azs = dependency.vpc-system-services.outputs.azs
  51. subnets = dependency.vpc-system-services.outputs.private_subnets
  52. roles = {
  53. mdr-admins = {
  54. token_policies = ["admins"]
  55. bound_groups = ["mdr-admins"]
  56. }
  57. mdr-engineers = {
  58. token_policies = ["engineers"]
  59. bound_groups = ["mdr-engineers"]
  60. }
  61. phantom-role-administrator = {
  62. token_policies = ["phantom"]
  63. bound_groups = ["phantom-role-administrator"]
  64. }
  65. vault-admins = {
  66. token_policies = ["admins"]
  67. bound_groups = ["vault-admins"]
  68. }
  69. analyst-shift-lead = {
  70. token_policies = ["soc"]
  71. bound_groups = ["analyst-shift-lead"]
  72. }
  73. analyst-tier-3 = {
  74. token_policies = ["soc"]
  75. bound_groups = ["analyst-tier-3"]
  76. }
  77. }
  78. }
  79. terraform_version_constraint = "= 1.1.6"
  80. terragrunt_version_constraint = "= 0.36.2"