Terraform: Automation On Aws
Terraform: Automation On Aws
A U T O M A T I O N O N A W S
CHAPTER #6
PACKER
PACKER
WHY USE?
packer
Packer is an OpenSource Image Provisioning tool
developed by Hashicorp. It creates machine images
and makes the Configuration Management and Server
provisioning an easy Job. It can create Images for
multiple platforms like Docker, AWS, Oracle Virtual
Box, Digital Ocean, OpenStack, Linode, Azure etc.
PACKER
WHY USE?
packer
Packer is easy to use and automates the creation of
any type of machine image. It embraces modern
configuration management by encouraging you to use
a framework such as Ansible, Chef or Puppet to install
and configure the software within your Packer-made
images.
TERRAFORM
ADVANTAGES
#2 Multi-provider portability
#3 Improved stability
#4 Greater testability
# unzip packer_1.4.5_linux_amd64.zip
PACKER
DOWNLOAD & INSTALL
PACKER
CONFIRMING
PACKER
CONFIRMING
PACKER
BUILDING IMAGE
simpleimage.json
Inspect and validate your file before starting the build
process.
Finally build a new packer image using your variable
file and json file as templates.
Actually Packer will create a new instance with your
configuration. Create a image out of it and then
terminate the instance.
You will find you AMI under "AMIs".
PACKER
BUILDING IMAGE #2
You can use a external script to be added with your
packer json file. You just need to pass the name of the
script file inside your json file. Here I have a
"apache.sh" script which I am adding as provisioner
inside my image's json file.
PACKER
BUILDING IMAGE #2
Just need to replace the "inline" to path / name of the
script inside the json file. Rest of the file, in my case,
is still the same.