asg.tf 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. module "indexer0" {
  2. source = "../../../submodules/splunk/splunk_indexer_asg"
  3. name = var.prefix
  4. asg_number = 0
  5. asg_name = "${local.asg_name}-0"
  6. launch_conf_name = "${local.launch_config_name}-0"
  7. volume_sizes = local.volume_sizes
  8. idx_instance_type = local.instance_type
  9. user_data = data.template_cloudinit_config.cloud-init.rendered
  10. indexer_security_group_ids = [data.aws_security_group.typical-host.id, aws_security_group.indexer_security_group.id]
  11. vpc_zone_identifier = [var.private_subnets[0]]
  12. key_name = "msoc-build"
  13. min_size = local.splunk_asg_sizes[0]
  14. max_size = local.splunk_asg_sizes[0]
  15. iam_instance_profile = module.instance_profile.profile_id
  16. common_services_account = var.common_services_account
  17. tags = merge(local.standard_tags, var.tags, var.instance_tags[0], { Name = "${local.asg_name}-0" })
  18. # 2022-04-22: FTD - Debugging dying indexers in test
  19. # 2022-07-18: FTD - This didn't help isolate the problem, or the problem hasn't recurred.
  20. #suspended_processes = var.environment == "test" ? ["Terminate"] : []
  21. }
  22. module "indexer1" {
  23. source = "../../../submodules/splunk/splunk_indexer_asg"
  24. name = var.prefix
  25. asg_number = 1
  26. asg_name = "${local.asg_name}-1"
  27. launch_conf_name = "${local.launch_config_name}-1"
  28. volume_sizes = local.volume_sizes
  29. idx_instance_type = local.instance_type
  30. user_data = data.template_cloudinit_config.cloud-init.rendered
  31. indexer_security_group_ids = [data.aws_security_group.typical-host.id, aws_security_group.indexer_security_group.id]
  32. vpc_zone_identifier = [var.private_subnets[1]]
  33. key_name = "msoc-build"
  34. min_size = local.splunk_asg_sizes[1]
  35. max_size = local.splunk_asg_sizes[1]
  36. iam_instance_profile = module.instance_profile.profile_id
  37. common_services_account = var.common_services_account
  38. tags = merge(local.standard_tags, var.tags, var.instance_tags[1], { Name = "${local.asg_name}-1" })
  39. # 2022-04-22: FTD - Debugging dying indexers in test
  40. # 2022-07-18: FTD - This didn't help isolate the problem, or the problem hasn't recurred.
  41. #suspended_processes = var.environment == "test" ? ["Terminate"] : []
  42. }
  43. module "indexer2" {
  44. source = "../../../submodules/splunk/splunk_indexer_asg"
  45. name = var.prefix
  46. asg_number = 2
  47. asg_name = "${local.asg_name}-2"
  48. launch_conf_name = "${local.launch_config_name}-2"
  49. volume_sizes = local.volume_sizes
  50. idx_instance_type = local.instance_type
  51. user_data = data.template_cloudinit_config.cloud-init.rendered
  52. indexer_security_group_ids = [data.aws_security_group.typical-host.id, aws_security_group.indexer_security_group.id]
  53. vpc_zone_identifier = [var.private_subnets[2]]
  54. key_name = "msoc-build"
  55. min_size = local.splunk_asg_sizes[2]
  56. max_size = local.splunk_asg_sizes[2]
  57. iam_instance_profile = module.instance_profile.profile_id
  58. common_services_account = var.common_services_account
  59. tags = merge(local.standard_tags, var.tags, var.instance_tags[2], { Name = "${local.asg_name}-2" })
  60. # 2022-04-22: FTD - Debugging dying indexers in test
  61. # 2022-07-18: FTD - This didn't help isolate the problem, or the problem hasn't recurred.
  62. #suspended_processes = var.environment == "test" ? ["Terminate"] : []
  63. }