#terraform-aws-modules - December 2019

December 2019
bazbremner
bazbremneralmost 7 years ago
Hello folks, long time lurker, first time caller here :)
bazbremner
bazbremneralmost 7 years ago
I'm building out a new infra for a small team and I'm making some use of the terraform modules, which are nice building blocks 👍️
bazbremner
bazbremneralmost 7 years ago(edited)
One thing that I'm pondering, but don't have an answer to at the moment is how folk manage their fleet of nodes in ASGs created by https://github.com/cloudposse/terraform-aws-ec2-autoscale-group; generally in the past I've used a pattern of naming the ASG after its LC with a create_before_destroy lifecycle, so as new LCs are produced, you end up with two ASGs behind one LB for the blue/green deploy.
bazbremner
bazbremneralmost 7 years ago
My reading of the docs (and a bit of a poke at the code) looks to me like this sort of model isn't supported, so how are folk doing rollouts of new config?
bazbremner
bazbremneralmost 7 years ago
Admittedly, I've generally done this behind ELBs, not ALBs/TGs, so I'm still piecing that together
bazbremner
bazbremneralmost 7 years ago
And now I realise I'm probably in the wrong channel. Doh 😕
joshmyers
joshmyersalmost 7 years ago
Is fine in here, just slow in the US atm , maybe @Erik Osterman (Cloud Posse) / @Andriy Knysh (Cloud Posse) have thoughts
joshmyers
joshmyersalmost 7 years ago
or some of the other regulars 🙂
Alex Siegman
Alex Siegmanalmost 7 years ago
I think Cloudposse prefers using their null-label module to standardize naming. A lot of their modules ask for three parts and use the null-label module behind the scenes as well.

Sounds like your use case is to create some blue/green fanciness, which in my experience doesn't play well with IAC. It has the same "what's the SDLC of this object" problem where you might create it with Terraform, but some scripting manages flipping things around or creation or what not.

I'm not sure what you mean by "LC" in your description there though.
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 7 years ago
we did not test https://github.com/cloudposse/terraform-aws-ec2-autoscale-group with blue/green, but you can create two ASGs in terraform and, if you use Kubernetes, assign diff kubernetes labels to the nodes so you could schedule pods on one group or the other
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 7 years ago
how to drain it and switch between the groups, a separate script/workflow needs to be created for that
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)almost 7 years ago
@bazbremner if you see anything on how to improve the module, especially for that use-case. PRs are always welcome
joshmyers
joshmyersalmost 7 years ago
I think it was likely more a question of is there a reason not to do it as @bazbremner mentioned, in particular the hinging of the ASG name to the Launch config name, so you get a new ASG behind the same LB, rather than mutating the current ASG but a diferent launch config for blue/green …. if that makes any sense…
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 7 years ago
So if it helps, our use-case was for EKS
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 7 years ago
we use this as the base module for provisioning the node pools
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)almost 7 years ago
since there are multiple node pools, one just drains/cordons one at a time and replace it
joshmyers
joshmyersalmost 7 years ago
Currently doing similar to above for our ECS deployments, canary.<service>.<domain> + main.<service>.<domain>
bazbremner
bazbremneralmost 7 years ago
@Alex Siegman LC == launch configuration, sorry.
bazbremner
bazbremneralmost 7 years ago
@Erik Osterman (Cloud Posse) OK, good to know, thanks. 👍️
Amun Duul
Amun Duulalmost 7 years ago
Hi all I’m currently evaluating using the terraform-aws-eks module. Could someone help me understand what the intention of the “resource “random_pet” “workers” is/