Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packer: Generate AMI from a running EC2 Instance

I woud like to create an AMI (Amazon Machine Image) from a running EC2 instance using Packers..

Here is my usecase:
1) Use packer to generate the base AMI and start the EC2 instance
2) Have user data configuration on the EC2 instance.. (Human Intervention needed here)
3) Generate an app specific AMI from step#2 using Packer

I don't want to use the "provisioner" provided by packers. I need a human intervention at step#2

like image 564
user3006942 Avatar asked Apr 16 '26 19:04

user3006942


1 Answers

The point of Packer seems to be to eliminate human intervention from the build process in order to make deployment consistent. However, per-instance data can be passed in through Packer user variables, which can be passed on the command line:

$ packer build \
    -var 'aws_access_key=foo' \
    -var 'aws_secret_key=bar' \
    template.json

or via a config file:

$ packer build -var-file=variables.json template.json
like image 178
Jeffrey Hantin Avatar answered Apr 18 '26 11:04

Jeffrey Hantin