Answer the question
In order to leave comments, you need to log in
Is Terraform suitable for updating an AMI image?
AWS has autoscaling groups / launch templates / target groups / ALBs.
From time to time, you need to update the AMIs used in launch templates - raise EC2 from the current AMI, run the script, create an updated AMI. Is Terraform suitable for this? I don't think so, but maybe I'm missing something?
Answer the question
In order to leave comments, you need to log in
Kind, Terraform is not very good, it's like an end user. Use packer to upgrade - best inside CI/CD pipeline. After updating ami, update the launch template in terraform by simply pointing to the (new) version of ami for ec2 machines.
But... in terraform, you can specify user_data with a bash script to run during instance initiation
https://www.bogotobogo.com/DevOps/Terraform/Terraf...
From time to time you need to update AMIs used in launch templatesA clear hint at an immutable (immutable) infrastructure. Best practice suggests that a freshly baked image should be cleaned of unnecessary and everything necessary should be installed. Then everything is tested and verified.
Is Terraform suitable for this?To deploy/upgrade with new AMI? Yes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question