Merge pull request #343 from vorlock/upstream_start_instances

Plugin: ec2_launch ssh key, instance type, etc. +
This commit is contained in:
Anders Ingemann 2016-09-21 16:30:52 +02:00 committed by GitHub
commit 6cef2bd37c
3 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1,22 @@
ec2-launch
----------
This plugin is spinning up **AWS classic instance** from the AMI created with
the template from which this plugin is invoked.
Settings
~~~~~~~~
- ``security_group_ids``: A list of security groups (not VPC) to attach to the
instance
``required``
- ``instance_type``: A string with AWS Classic capable instance to run
(default: m3.medium)
``optional``
- ``ssh_key``: A string with the ssh key name to apply to the instance.
``required``
- ``print_public_ip``: A string with the path to write instance external IP to
``optional``
- ``tags``:
``optional``
- ``deregister_ami``: A boolean value describing if AMI should be kept after
sinning up instance or not (default: false)
``optional``

View file

@ -14,6 +14,7 @@ properties:
items: {type: string}
uniqueItems: true
instance_type: {type: string}
ssh_key: {type: string}
print_public_ip: {type: string}
tags: {type: object}
deregister_ami: {type: boolean}

View file

@ -25,7 +25,9 @@ class LaunchEC2Instance(Task):
conn = info._ec2['connection']
r = conn.run_instances(info._ec2['image'],
security_group_ids=info.manifest.plugins['ec2_launch'].get('security_group_ids'),
instance_type=info.manifest.plugins['ec2_launch'].get('instance_type', 't2.micro'))
key_name=info.manifest.plugins['ec2_launch'].get('ssh_key'),
instance_type=info.manifest.plugins['ec2_launch'].get('instance_type',
'm3.medium'))
info._ec2['instance'] = r.instances[0]
if 'tags' in info.manifest.plugins['ec2_launch']: