terragrunt.hcl 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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=v1.23.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. okta_oidc_client_id = "0oa5icfdd1PdtoER0297"
  54. okta_oidc_client_secret = "<place secret here>"
  55. okta_api_token = "<place secret here>"
  56. roles = {
  57. mdr-admins = {
  58. token_policies = ["admins"]
  59. bound_groups = ["mdr-admins"]
  60. }
  61. mdr-engineers = {
  62. token_policies = ["engineers"]
  63. bound_groups = ["mdr-engineers"]
  64. }
  65. phantom-role-administrator = {
  66. token_policies = ["phantom"]
  67. bound_groups = ["phantom-role-administrator"]
  68. }
  69. vault-admins = {
  70. token_policies = ["admins"]
  71. bound_groups = ["vault-admins"]
  72. }
  73. analyst-shift-lead = {
  74. token_policies = ["soc"]
  75. bound_groups = ["analyst-shift-lead"]
  76. }
  77. analyst-tier-3 = {
  78. token_policies = ["soc"]
  79. bound_groups = ["analyst-tier-3"]
  80. }
  81. }
  82. }