#packer - March 2020

packerArchived
6 messages

Discuss Packer for building AMIs and Docker Images
Archive: https://archive.sweetops.com/packer/

ikar
ikarover 6 years ago
Hey there!
I'm about to build (AWS) AMIs via crontab on one of our service machine. Afterwards I'll update Lanch conf + autoscaled group with python and boto3.
How do you "rotate" the machines in the autoscaled group?
I know terraform can be used fot this, but I feel like i don't want to run terraform automatically. Not quite sure why. The only concern is it should also commit TF state changes - I know, this is not recommended way how to store state, shame on me.
ikar
ikarover 6 years ago(edited)
so in other words: do you usually run terraform programmatically? based on some external events?
David
Davidover 6 years ago
If you want to do it in a script, here's a ts-node script I wrote yesterday that runs a command on each instance to gracefully kill its process, then shuts down the instance, then waits for a new healthy instance to come up, then repeats with all other nodes until all nodes have been cycled.

The commands in python would likely be very similar
ikar
ikarover 6 years ago
Thanks @David! This is exactly what I needed to see 😉
Helped me building my (slightly simpler) python script 😃
Jason Walsh
Jason Walshover 6 years ago
Hi all. Last weekend I started a small project that is a web user interface for generating Packer templates. The project is still in its infancy and has a lot of room for improvement, but I'd love to get some feedback. The source code is here: https://github.com/jasonwalsh/punk.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 6 years ago
Adding @U010XGY9B46 bot