Terraform V/S Packer

1,071 views
Skip to first unread message

Deepak Sharma

unread,
May 18, 2016, 1:49:16 PM5/18/16
to Terraform
Hi Group Members,

I am a noob to these tools. What I understood from documentation is "I can create AMI image on AWS using terraform's AWS_AMI_FROM_INSTANCE resource". Which is the sole purpose of packer.

I am not sure in use case, where I need to create EC2 instance and configure it, then create an image; should I use packer anyway? What other advantages can a packer have? Why these are two tool instead of one? I mean there should be some specific reason for both of those.

Any link/doc will be helpful.

Thanks for kind responses.

Deepak

Ian Duffy

unread,
May 18, 2016, 1:52:01 PM5/18/16
to terrafo...@googlegroups.com
Packer should only be used for creating your AMIs, if you wish to bake some configuration, package, text file, etc. use packer.

Terraform is for orchestrating the deployment of your applications including but not limited to:

 - security group configuration
 - load balancer configuration
 - provisioning of instances, bootstraping and executing them to some configuration management solution
 - etc.

Terraform maintains a state and allows you to go back and manipulate the infrastructure. 

Please google and read the appropriate documentation around both tools to understand their full functions. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/08325d32-8451-49bc-87a5-97887fe4d906%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Deepak Sharma

unread,
May 18, 2016, 2:00:23 PM5/18/16
to terrafo...@googlegroups.com
Hi Ian,

Thank you very much for reply and elaborating on rollback with terraform. This primarily helps, this was initial doubt and was not getting some clear difference. I am reading through documentation as well :)

Deepak


You received this message because you are subscribed to a topic in the Google Groups "Terraform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/terraform-tool/7hs1GA73E38/unsubscribe.
To unsubscribe from this group and all its topics, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/CAEJ3w4UDSy1noPfLBg7buYh_j9d9SqMuAVzv-MwzrTtz%3DV25wA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks & Regards
Deepak Sharma

David Maze

unread,
May 18, 2016, 2:25:18 PM5/18/16
to Terraform
On Wednesday, May 18, 2016 at 1:49:16 PM UTC-4, Deepak Sharma wrote:
I am a noob to these tools. What I understood from documentation is "I can create AMI image on AWS using terraform's AWS_AMI_FROM_INSTANCE resource". Which is the sole purpose of packer.

I am not sure in use case, where I need to create EC2 instance and configure it, then create an image; should I use packer anyway? What other advantages can a packer have? Why these are two tool instead of one? I mean there should be some specific reason for both of those.

Creating an AMI has a pretty specific lifecycle pattern: create an instance, provision it, stop it, create disk snapshots, create the AMI, wait (a long time) for it to become available, destroy the instance.  Packer does a good job of encapsulating that specific pattern.  It's a little outside Terraform's core space, though; Terraform doesn't have a good way to say "this instance must exist but only as long as this other operation is going on".

I use Terraform+Packer+Ansible, and totally ignore the Terraform AMI building support.  That does mean that, if I build a new AMI, I need to manually change the AMI number in my Terraform source files.

Deepak Sharma

unread,
May 20, 2016, 1:46:47 AM5/20/16
to Terraform
Hi David,

Thanks a lot for the reply. I understand it how packer is specialized for AMI creation, where terraform on other hand deployment having less focus on Image creation. Thanks Ian and David for sharing the knowledge.

Deepak
Reply all
Reply to author
Forward
0 new messages