NixOS / nixops-aws

GNU Lesser General Public License v3.0
52 stars 38 forks source link

Nixops doesn't support AWS ALB (app load balancers) #50

Open deepfire opened 5 years ago

deepfire commented 5 years ago

Just a place to facilitate discussion.

charukiewicz commented 5 years ago

Working with this today, it appears that there is no way to get a EC2 instance deployed by NixOps to be registered into an AWS target group (which is what an ALB will route traffic to). Even if NixOps is not capable of creating app load balancers, it would be very helpful to assign EC2 instances to a target group (and in effect add them to a load balancer).

It would be ideal if this worked in a way similar to assigning security groups. For example:

{
  deployment.targetEnv = "ec2";
  deployment.ec2.instanceType = "m1.small";

  # not currently a real option
  deployment.ec2.targetGroups = [ "app-servers" "app-servers-https" ];
}

The challenge is that target groups are managed through the Elastic Load Balancer API, and not the EC2 instance API. So whereas fields like securityGroups or placementGroup are EC2 settings, target groups are not.