Package: ploy-ec2
OverviewThe ploy_ec2 plugin provides integration ofAmazon EC2withploy.Installationploy_ec2 is best installed with easy_install, pip or with zc.recipe.egg in a buildout.MastersTo use ploy_ec2 you need an Amazon account andAWS keys.Once you got your keys, you should put them in a secure location and reference them in yourploy.conf.
Additionally you need to set the region of the master:[ec2-master:ec2eu]
access-key-id = ~/.aws/ec2.id
secret-access-key = ~/.aws/ec2.key
region = eu-west-1You can also set theAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYenvironment variables instead.You need to define a master for eachregionyou want to use.InstancesEach instance has the following mandatory settings:imageTheAmazon Machine Image (AMI)that this instance will start up with.keypairThe name of theSSH keypairto use.placementTheavailability zonein which to launch the instances.securitygroupsThe name of theSecuritygroupsthis instance should be assigned to.The following settings are optional:instance_typeipstartup_scriptPath to a script which will be run right after creation and first start of the instance.
This uses theUser Datafeature and needs to be supported by the AMI.volumessnapshotsdevice_mapdelete-volumes-on-terminateSecuritygroupsdescriptionconnections[ec2-securitygroup:app-server]
description = The production server
connections =
    tcp     22      22      0.0.0.0/0
    tcp     80      80      0.0.0.0/0VolumesYou can define volumes viaec2-volumesections.
The id of the section must not start withvol-.
You can declare thesizeas a number of GB.If the volume doesn’t exist, it is automatically created.[ec2-volume:a-volume-name]
size = 100

[ec2-instance:foo]
...
volumes = a-volume-name /dev/sdfMacro expansionFor instances theipandvolumesoptions aren’t copied when expanding macros.Fingerprint verificationAutomatic ssh fingerprint verification works by checking whether the fingerprint is in the console output of the instance.After reboot or stop/start of an instance, the console output is refreshed.
The problem with that is, that the fingerprint isn’t included in the console anymore by default.
To fix that you need to log the fingerprint on reboot somehow.
One way to do that with Ubuntu is to add a script at/var/lib/cloud/scripts/per-boot/ssh-keyswith this content:#!/bin/sh/usr/bin/ssh-keygen-l-f/etc/ssh/ssh_host_rsa_key.pubMake sure that script is executable.Changelog2.0.0 - 2022-08-17Drop support for Python < 3.7.
[fschulze]Add support for Python up to 3.10.
[fschulze]2.0.0b1 - 2018-02-07Support for ploy 2.0.0.
[fschulze]Support yet another ssh key output format from console output of instance.
[fschulze]1.2.0 - 2015-09-03Check status of volume to give helpful error message if it’s still attached.
[fschulze]Allow volume definition viaec2-volumesections.
[fschulze]Fix support of console output for theploy debug-ccommand.
[fschulze]Reuse init_ssh_key from ploy.plain to get way more options and error checking.
[fschulze]1.1.1 - 2015-01-22Only set device_map if it’s in the config, the previousNonedefault
didn’t always work.
[fschulze]Fixed console output availability test for the status command.
[fschulze]Better error message if fingerprint isn’t in console output.
[fschulze]There can be multiple instances for the same name if they were quickly started
and stopped. Handle that case when requesting status of master.
[fschulze]1.1.0 - 2014-10-27Print status of all ec2 instances when requesting status of master.
[fschulze]1.0.0 - 2014-07-19Added documentation.
[fschulze]1.0b4 - 2014-07-15Fix confusion between instance from ploy and ec2 instance.
[fschulze]1.0b3 - 2014-07-08Movedsnapshotslist command here after ploy enabled it.
[fschulze]Renamed mr.awsome to ploy and mr.awsome.ec2 to ploy_ec2.
[fschulze]1.0b2 - 2014-05-15Renamedconntoec2_connto allow reuse ofconnfrom BaseInstance.
[fschulze]Moved setuptools-git from setup.py to .travis.yml, it’s only needed for
releases and testing.
[fschulze]1.0b1 - 2014-03-24Initial release
[fschulze]