Skip to main content

Overview

The ploy_ec2 plugin provides integration of Amazon EC2 with ploy.

Installation

ploy_ec2 is best installed with easy_install, pip or with zc.recipe.egg in a buildout.

Masters

To use ploy_ec2 you need an Amazon account and AWS keys.

Once you got your keys, you should put them in a secure location and reference them in your ploy.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-1

You can also set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables instead.

You need to define a master for each region you want to use.

Instances

Each instance has the following mandatory settings:

image

The Amazon Machine Image (AMI) that this instance will start up with.

keypair

The name of the SSH keypair to use.

placement

The availability zone in which to launch the instances.

securitygroups

The name of the Securitygroups this instance should be assigned to.

The following settings are optional:

instance_type

ip

startup_script

Path to a script which will be run right after creation and first start of the instance. This uses the User Data feature and needs to be supported by the AMI.

volumes

snapshots

device_map

delete-volumes-on-terminate

Securitygroups

description

connections
[ec2-securitygroup:app-server]
description = The production server
connections =
    tcp     22      22      0.0.0.0/0
    tcp     80      80      0.0.0.0/0

Volumes

You can define volumes via ec2-volume sections. The id of the section must not start with vol-. You can declare the size as 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/sdf

Macro expansion

For instances the ip and volumes options aren’t copied when expanding macros.

Fingerprint verification

Automatic 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-keys with this content:

#!/bin/sh
/usr/bin/ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub

Make sure that script is executable.

Changelog

2.0.0 - 2022-08-17

  • Drop support for Python < 3.7. [fschulze]

  • Add support for Python up to 3.10. [fschulze]

2.0.0b1 - 2018-02-07

  • Support for ploy 2.0.0. [fschulze]

  • Support yet another ssh key output format from console output of instance. [fschulze]

1.2.0 - 2015-09-03

  • Check status of volume to give helpful error message if it’s still attached. [fschulze]

  • Allow volume definition via ec2-volume sections. [fschulze]

  • Fix support of console output for the ploy debug -c command. [fschulze]

  • Reuse init_ssh_key from ploy.plain to get way more options and error checking. [fschulze]

1.1.1 - 2015-01-22

  • Only set device_map if it’s in the config, the previous None default 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-27

  • Print status of all ec2 instances when requesting status of master. [fschulze]

1.0.0 - 2014-07-19

  • Added documentation. [fschulze]

1.0b4 - 2014-07-15

  • Fix confusion between instance from ploy and ec2 instance. [fschulze]

1.0b3 - 2014-07-08

  • Moved snapshots list command here after ploy enabled it. [fschulze]

  • Renamed mr.awsome to ploy and mr.awsome.ec2 to ploy_ec2. [fschulze]

1.0b2 - 2014-05-15

  • Renamed conn to ec2_conn to allow reuse of conn from BaseInstance. [fschulze]

  • Moved setuptools-git from setup.py to .travis.yml, it’s only needed for releases and testing. [fschulze]

1.0b1 - 2014-03-24

  • Initial release [fschulze]

Release files for ploy-ec2 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ploy-ec2 2.0.0
File Size Uploaded
ploy_ec2-2.0.0.tar.gz 17.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ploy-ec2 2.0.0
File Interpreter ABI Platform
ploy_ec2-2.0.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 32.2 kB

Release files / ploy_ec2-2.0.0.tar.gz

Download URL ploy_ec2-2.0.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b91edcf89e88e52d9b70604cde2893122f9f2d85abf48783c43e325694dc3258
BLAKE2b-256 checksum
How to use checksums
d7e8ffde1b4627bab7ea6f3b64433a6f8bd1a44fa8336b0ad6ad6f7af1703d46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via devpi-server/6.1.0 (py3.8.6; darwin)

Release files / ploy_ec2-2.0.0-py2.py3-none-any.whl

Download URL ploy_ec2-2.0.0-py2.py3-none-any.whl
Size 14.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9211bfa9bb146470669ff32f3a36875e98c53ca4b3f0b1e8eebce60b8d95f026
BLAKE2b-256 checksum
How to use checksums
c290785cc3d76c440cd6affc575fa99a271c2e4282d631ba8259f8b620d664fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via devpi-server/6.1.0 (py3.8.6; darwin)

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.2.0

2 release files

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page