简体   繁体   中英

Can a custom private AWS AMI be used as a base for creating a new packer image

I'm new to using Packer and I was wondering if when configuring the 'builders' section of the Packer JSON file if a 'custom', non-public AMI can be used in the 'source_ami' setting as the base image? I would like to use an AMI that has been customized as the 'base' AMI used by Packer to build a new AMI.

...
"builders": [{
   "type": "amazon-ebs",
   "communicator": "ssh",
   "ssh_pty": "true",
   "access_key”: "{{user `aws_access_key`}}",
   "secret_key”: "{{user `aws_secret_key`}}",
   "region": "eu-west-1",
   "source_ami": "ami-my-custom,
   "instance_type": "t2.micro",
   "ssh_username": "ubuntu",
   "ami_name": "new-ami-from-custom {{timestamp}}"
 }],
...

You can use custom vm import and create an image out of it and then use it packer, though I have never tried the same you can try following the same with this doc: https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM