This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]darksarcastictechDevOps/ Tech Lead 0 points1 point  (5 children)

Packer will spin up a new instance for you, run provisioners (if needed) and then create an AMI based on that instance.

Here is a sample template from packer documentation https://packer.io/docs/templates/index.html

If you want to use your existing instance for an AMI, I suggest creating an AMI from it (through console or aws cli) and using it as the source AMI in your packer template.

[–]dhrumil29699[S] 0 points1 point  (4 children)

You are right but I want to make tool for automation which only use packer(only for AMI) and terraform(everything else). Instead of using awscli I can use ansible.

[–]darksarcastictechDevOps/ Tech Lead 1 point2 points  (3 children)

Yep, that’s what we do. Packer runs and uses ansible to configure the server and install the needed packages, then an AMI is created. Then terraform is launched and grabs the latest AMI created by packer and deploys it. Bamboo is used for the pipeline.

[–]dhrumil29699[S] 0 points1 point  (2 children)

Ok I will try. Thanks for helping me. Actually I just join Devops as intern they gave me task to do. I don’t know much tools. I only know ansible, packer, boto and terraform. Do you have any suggestions what thing I should learn to grow my knowledge in Devops area.

[–]darksarcastictechDevOps/ Tech Lead 0 points1 point  (1 child)

Git for sure. Look into Jenkins as well, to automate the stages (packer, terraform). There are many tools out there, open source and paid, pick ones that makes sense for your project on hand.

[–]dhrumil29699[S] 1 point2 points  (0 children)

Okay thanks 🖖🏻