0

We want to increase number of EMR clusters as per requirements, and integrate those clusters with AWS-ALBs (Application Load Balancers)

We are thinking of provisioning multiple AWS-ALBs during a Terraform deployment, and then integrate those EMR clusters with ALBs, Where use-case also involves resiliency towards Create/Update and Delete of EMR clusters.

Any idea how to solve this use-case in best possible way , ie,

  1. How do we provision multiple alb instances in one Terraform deploy ?
  2. How should we integrate those ALBs to EMR clusters in best possible way ?
  • I am not expecting code, just some help and direction would work, Since I myself am not too good at Tf, I am unable to provide any TF code or minimum reproducible example. – Nikhil Chauhan Sep 14 '21 at 04:43
  • 2
    Are you saying you want an ALB per EMR cluster? What's the point of the ALB here? – ydaetskcoR Sep 14 '21 at 07:08
  • Define multiple ALB resources in your terraform code. Or define a single ALB resource with a `for_each`. Your question is so vague. Do it the same way you define multiple of **anything** in Terraform. What exactly are you stuck on? – Mark B Sep 14 '21 at 13:49
  • So the use-case is that I might have 100 EMR clusters, now there is a limit to number of emr clusters I can attach to a particular ALB. Thus to scale it up, suppose I have 5 ALBs, I can connect 20 emr clusters each one of them thus effectively scaling even with the limitation. – Nikhil Chauhan Sep 14 '21 at 16:19
  • @ydaetskcoR There are multiple applications inside my clusters whose web interfaces I have to expose, thus those services need to be connected to ALBs – Nikhil Chauhan Sep 14 '21 at 16:23
  • @MarkB to be honest the terraform "terraform-aws-alb" doesn't have count like we had in s3 and other modules, where I can specify number of instances I want. I did explore the idea of for_each, and the issue with that is how do I tap into cluster info, to get a appropriate number of iterations that I should do so as to provide just the minimum number of resources and not overcreate – Nikhil Chauhan Sep 14 '21 at 16:42

0 Answers0